Click to See Complete Forum and Search --> : gotoAndStop
marinebro0306
09-14-2005, 08:18 AM
I am making a simple punching game where you beat up George Bush, because he's an idiot. I have a group of symbols or vectors (whatever you draw with). I have one as a mouth, with a group of these that is grouped into a movie clip, cleverly called mouth. The first frame is the regular mouth with the stop(); action, and the second frame is George Bush, who is an idiot's, mouth. In that MC is an Actionscript action with the following:on(press){
mouth.gotoAndStop(2)}But whenever I click it, it doesn't do anything.
Anyone who helps will be put in the credits.
blanius
09-14-2005, 09:08 AM
if this code is in the mouth clip you would use
this.gotoAndStop(2)
Also note using numbers is not reliable, name that frame something like "idiot" and then use
this.gotoAndStop(idiot)
no credit needed.
there is another way to reference it that would be _parent.mouth.gotoAndPlay(idiot) but that seems the long way around to me.
Bob Hartzell
09-14-2005, 10:53 AM
You need gotoAndPlay("idiot") with quotes around idiot
idiot without the quotes will be treated as a variable
To clarify the problem with using 2: the 2 refers to the total of key frames plus tweens and that is not easy to determine. The swf doesn't differentiate between key frames and tweens; it just deals with frames.
From my own standpoint, using a number is problematic. Is the first frame 0 or 1. In the swf it is 0 but in the function call it is 1.
gusmus
09-14-2005, 11:42 AM
Hey Marinebro,,, Your game is going to be a hit. Have you noticed how everyone is using the operative word "Idiot" without any prompting? Just assign all of his various body parts as "Idiot1, Idiot2, Idiot3, etc" and by the time you are finished you will have a "Complete Idiot".
blanius
09-14-2005, 11:44 AM
LOL I felt like an idiot for leaving out the quotes....... :yikes:
marinebro0306
09-14-2005, 05:14 PM
Thanks guys :thumbsup:
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.