|
-
Always needs help
gotoAndStop
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:code: on(press){
mouth.gotoAndStop(2)}
But whenever I click it, it doesn't do anything.
Anyone who helps will be put in the credits.
-
KoolMoves Moderator
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.
-
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.
-
Can't Re- Member
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".
humanus somes est divinitus in ipsum
Wiliiam Wallace
-
KoolMoves Moderator
LOL I felt like an idiot for leaving out the quotes.......
-
Always needs help
Thanks guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|