>Let's start with some pseudo-definitions: >
Thank you for taking the time and trouble to provide such a detailed explanation. I've learnt a lot from what you have written. I placed the following behavior script in my movie: property markerName property jumpMode on getPropertyDescriptionList(me) tPropertyList = [:] tPropertyList[#markerName] = [ #comment: "On mouseUp, go to marker:",\ #format: #marker, \ #default: #next \ ] tPropertyList[ \ #jumpMode] = [ #comment: "Jump mode:", \ #format: #string, \ #range: ["Go to", "Play and Return"], \ #default: "Go to" \] return tPropertyList end getPropertyDescriptionList When I write it in this way, I get an error with this message: Script error: Variable used before assigned value tPropertyList[#markerName] = [ #comment: "On mouseUp, go to marker:", \ #format: #marker, \ #default: #next \ ] Isn�t this what you have kindly provided me? Which variable was used before being assigned a value? I don�t get it. Or I should not be writing it in this way? > The getPropertyDescriptionList() handler is called at author-time only, >so I will include a comment to indicate this just before the handler. I do not understand this. I have checked Lingo in a Nutshell and Special Edition using Macromedia Director 8, but I could find no answer. Sorry if it sounds like a stupid question but if they are called at author-time when are they executed? > Other author-time only handlers will be placed in the same section >of >the script: May I clarify that the scripts must be behavior scripts only? >6. I now determine what events the behavior will need to deal, and create > an event handler for each such event. I try to keep event handlers as > short as possible, so that they explain what happens, but do not go >into > any details: > > on mouseUp(me) > me.mJumpToMarker() > end prepareFrame > I am not sure where to place this script. After reading Lingo in a Nutshell pg 78 � 80, am I to understand that this is to be placed in a movie script? >7. After these preparations, I am ready to write the main bulk of the code. > I separate this off into a section called "Private Methods", to >indicate > that the handlers in that section should never be called from anywhere > else. Director lets you call any handler anywhere at any time, so this > is merely a semantic distinction. I include a description of the >action >of each handler at the start: It is getting very confusing. I�m sorry, why are there so many sections? Are you referring to different scripts or different sections of the same script? > > -- PRIVATE METHOD -- > > on me.mJumpToMarker(me) --------------------------------------------- > -- SENT BY: mouseUp() > -- ACTION: Jumps the playback head to the chosen marker... if it > -- still exists > ------------------------------------------------------------------- > > -- Determine which frame is indicated by markerName > case markerName of > #previous: tFrameNumber = marker(-1) > #loop: tFrameNumber = marker(0) > #next: tFrameNumber = marker(1) > otherwise: > tFrameNumber = marker(markerName) > end case > > if tFrameNumber then > if jumpMode = "Go to" then > go tFrameNumber > else -- play => play done > play tFrameNumber > end if > else > -- markerName no longer exists > end if > end me.mJumpToMarker > Anyway, I placed this behavior script into my movie. I received this error message. Script error; Symbol expected on me.mJumpToMarker(me) On pg 267 of Special Edition using Macromedia 8 , properties in a list are known as symbols and anything prefaced by # character is a symbol. In this case how do I define it? I don�t understand. Aren�t symbols defined only in lists? >8. More complex behaviors may also include a "Public Methods" section which > includes so-called Accessor and Mutator methods: handlers which allow > a different script to access information inside the behavior, or to > change the value of the behavior's properties. These handlers are >often > written "defensively" so that a call made using the wrong syntax will >not > cause any problems: > > -- PRIVATE METHOD -- > > on mSetJumpMode(me, aJumpMode) -------------------------------------- > -- Mutator method > -- ACTION: Modifies jumpMode if <aJumpMode> is a recognized value > ------------------------------------------------------------------- > case aJumpMode of > "Go to", "Play and Return": jumpMode = aJumpMode > otherwise: -- ignore the call since the value not recognized > end case > end mSetJumpMode > > I placed this script back into the original behavior script together >with on me.mJumpToMarker(me) and the on GetPropertyDescriptionList handler. I then received this error message: Script error: name already used on me.mJumpToMarker(me) When I placed it in another behavior script, I received the other error message.(the one about symbols). I�m sorry. Why am I receiving so many error messages? Am I placing the scripts incorrectly in my movie? Most of the scripts are behavior scripts aren�t they? May I also ask: The GetPropertyDescriptionList handler works only for sprites on stage? What happens if the sprites were not on stage? May I still use this handler? >10. Should I have mentioned testing early, testing often and testing on all > target platforms somewhere? > Yes, I will do that too. Thank you. I do appreciate your help. Genevieve _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp [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!]
