Hi, At 01:14 PM 5/9/2002 -0500, you wrote:
>So here it is. This is another take on the volume button behavior for >QuickTime audio. There are three behaviors here. One is attached to the >volume button; one is attached to the target QuikckTime audio sprite(s); >the third is a framescript behavior and goes into channel 0. This third >behavior is the intermediary that prevents direct communication amongst >behaviors and thus forestalls script error occurrences. Need the intermediary always be a frame script? >As you can see this is relatively intricate, but it's got the distinct >advantage of being pretty flexible. You can actually have as many QT >sprites as you want in a frame, How do I have as many QT sprites as I want in a frame? Does not a frame contain only 1 sprite? I am confused. >and you can change their channel numbers at will, and as long as the >settings for the behaviors in the PI are correct, everything should work >in a completely error-free way. > >All you have to do once these behaviors are made is attach the QT one to >your QT sprites, and name each one however you want to; then attach the >volume one to the volume buttons, specifying the name of the QT sprite >whose volume is to be adjusted (this would be the name you already gave to >the QT sprite). Then put the channel 0 script into the frame script >channel, hit play, and off you go. May I understand what you are writing in these scripts? >-- For the volume buttons > > PROPERTY pyMyDirection > PROPERTY psTargetName > > on beginSprite me > me.InitializeMyProps() > END beginSprite What is the purpose of me.InitializeMyProps()? > on mouseUp me > if psTargetName = "no_sprite" then > put "No QT sprite has been set for behavior" && (me.spriteNum) > exit > end if > sendSprite ( 0, #AdjustVolume, pyMyDirection, psTargetName ) > END mouseUp If there is no QT sprite, then where is "No QT sprite has been set for behavior� placed? What is the meaning of sendSprite here? > on InitializeMyProps me > if voidP ( pyMyDirection) then > pyMyDirection = #down > end if > if voidP ( psTargetName ) then > psTargetName = "no_sprite" > end if > END InitializeMyProps I presume this is your custom behavior? Why did you initialize it in on beginSprite me? The purpose of void is to prevent the use of a sprite other than QT? > on getPropertyDescriptionList me > lProps = [:] > lProps.addProp( #psTargetName, [#default: "name", #format: #string,\ > #comment: "Name of target sprite?"] ) > lProps.addProp( #pyMyDirection, [#default: #down, #format: #symbol,\ > #comment: "Adjust sound down or up?" #range: \ > [#down, #up] ] ) > return lProps > END getPropertyDescriptionList > >-- For the QuickTime sprites > > PROPERTY psMyName > > on beginSprite me > me.InitializeMyProps() > END beginSprite > > on InitializeMyProps me > if voidP ( psMyName ) then > psMyName = "no_sprite_" & (me.spriteNum) > end if > END InitializeMyProps Should there be two && here? If the property is void, then the command doesn�t execute? Would the QT script be classified as a cast member script? > on ReturnInfo me > return psMyName && (me.spriteNum) > END ReturnInfo What is the purpose of on ReturnInfo me? You are calling it in the channel 0 script? Why? > on AdjustQTVolume me, nIncrement > if sprite(me.spriteNum).member.type <> #quickTimeMedia then > put "Sprite" && (me.spriteNum) && "is not a QuickTime sprite." > exit > end if > sprite(me.spriteNum).volume = \ > sprite(me.spriteNum).volume + nIncrement > END AdjustQTVolume Is this another test for the volume? What is the meaning of "Sprite" && (me.spriteNum) && "is not a QuickTime sprite"? Is this stringing variables? > on getPropertyDescriptionList me > lProps = [:] > lProps.addProp( #psMyName, [#default: "name", #format: #string,\ > #comment: "Name of this sprite?"] ) > return lProps > END getPropertyDescriptionList > >-- For the channel 0 script > > PROPERTY plQTSpriteList > > on beginSprite me > me.InitializeMyProps() > END beginSprite > > on exitFrame me > go the frame > END exitFrame > > on InitializeMyProps me > plQTSpriteList = [:] > nAllSprites = the lastChannel > repeat with nChannel = 1 to nAllSprites > sReturn = sendSprite ( nChannel, #ReturnInfo ) > if voidP ( sReturn ) then > next repeat > else > nAllWords = the number of words in sReturn > nSpriteNum = value ( sReturn.word[nAllWords] ) > sSpriteName = sReturn.word[1..(nAllWords - 1 )] > if sSpriteName <> "no_sprite_" & nSpriteNum then > plQTSpriteList.addProp ( sSpriteName, nSpriteNum ) > end if > end if > end repeat > END InitializeMyProps What is the meaning of plQTSpriteList = [:]? I do not understand. What are you doing here? > on AdjustVolume me, yDirection, sTarget > nSprite = plQTSpriteList[sTarget] > if voidP ( nSprite ) then > put "Sprite" && sTarget && "is not registered as a QT sprite." > exit > end if > if yDirection = #up then > nAdjustIncrement = 1 > else > nAdjustIncrement = -1 > end if > sendSprite ( nSprite, #AdjustQTVolume, nAdjustIncrement ) > END AdjustVolume This is another test for volume? After some effort, I have managed to copy and paste the above script into my movie. I have also checked and re-checked it to make sure it is exactly the same as written above. When I initially copied and pasted in the script, there was some conflict within my movie. All my rollover changes on all the sprites had disappeared. So did all my jump to various markers like quit, back and next . Why? This caused my movie to hang by returning to the previous frame. At least I found the cause of my errors but still the movie couldn�t run properly� In future how do I prevent this from happening? Then I tried to place back all my rollovers and the rollover changes. I received this message: 'An error occurred. Property access error. Argument out of valid range.' Why did this have to happen? I could not even place any bitmaps or their rollovers. Director refused to allow me to amend these sprites. Luckily, I was able to revert to an earlier saved version of my movie. But there was a little trouble as I had to re-do various parts of my movie� I know that you have put in much effort writing this script for me and I feel very bad that I have to write this. On playing the movie, and clicking the volume control button, I was unable to make the volume increase or decrease. When I created a new program and put in only the volume control buttons and the QT music sprite together with the scripts you had written, there was still no changes in the volume. I really sorry, but where is my mistake? Thank you for taking the trouble to reply, Noelle [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
