At 22:08 +0800 05/13/2002, noelle cheng 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?

No, it can be attached to a sprite somewhere. I put it into a 
framescript here to simplify sprite messaging. Framescripts are 
always sprite 0.

>>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?

Put as many as you want to into that frame.

>Does not a frame contain only 1 sprite?  I am confused.

A frame can contain up to 1000 sprites. Each channel in a frame can 
hold a sprite.

>What is the purpose of  me.InitializeMyProps()?

It is a call to a handler to make sure that there are valid valuse 
assigned to the property variables in the behavior.

>If there is no QT sprite, then where is "No QT sprite has been set 
>for behavior�  placed?

Into the message window -- 'put' tells Director to send whatever 
follows to the message window. Generally you only have that in author 
mode.

>What is the meaning of sendSprite here?

sendSprite is a command that sends instructions to another sprite, 
telling it to execute another handler.

>>    on InitializeMyProps me
>>      if voidP ( psMyName ) then
>>        psMyName = "no_sprite_" & (me.spriteNum)
>>      end if
>>    END InitializeMyProps
>
>Should there be two && here?

No, I wanted the variable to concatenate without a space, so I used 
the single &, not the double.

>If the property is void, then the command doesn�t execute?

If the property is void the command *does* execute.

>Would  the QT script  be classified as a  cast member script?

No, there are no Cast member scripts here. These are three behaviors, 
two for sprites and one for the frame script. They're attached in the 
Score rather than being attached to Cast members themselves.

>>    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?

There is another handler that makes use of this command. That's how 
the other behaviors know which sprites have QuickTime audio adjusting 
behaviors attached.

>>    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?

No, it's a test to determine if the target sprite is QuickTime. If it 
is, volume is adjusted. Otherwise you get an error message in the 
message window.

>What is the meaning of "Sprite" && (me.spriteNum) && "is not a 
>QuickTime sprite"? Is this stringing variables?

It's putting together a message as text, to be put into the message window.

>What is the meaning of    plQTSpriteList = [:]?

I'm setting a variable to an initial empty value.

>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?

No, it's another failsafe check the validity of a sprite. If a sprite 
gets moved, or a behavior gets misattached, the dynamics of the 
behaviors might change -- and so they have to have methods built in 
to handle possible errors without actually causing the program to 
stop functioning.

>All my rollover changes on all the sprites had disappeared.  So did 
>all  my jump to  various markers like quit, back  and  next .  Why?

I don't know. Nothing I wrote should have an adverse effect on 
anything else, but you should know that there can only be one *frame* 
script in a given frame.

>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?

Again, I don't know. There's simply no way to answer that kind of 
question without actually being present in the room with you, 
unfortunately.

>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?

Again, I don't know. How did you attempt to get the file to work? In 
what way did you attach the behaviors? Did you get parameters dialog 
boxes, and did you set them up?

-- 

              Warren Ockrassa | http://www.nightwares.com/
  Director help | Free files | Sample chapters | Freelance | Consulting
        Author | Director 8.5 Shockwave Studio: A Beginner's Guide
                    Published by Osborne/McGraw-Hill
         http://shop.osborne.com/cgi-bin/osborne/0072195622.html
[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!]

Reply via email to