A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: gotoAndStop

  1. #1
    Always needs help marinebro0306's Avatar
    Join Date
    Jul 2005
    Location
    Philadelphia
    Posts
    166

    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.

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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.

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    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.

  4. #4
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663
    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

  5. #5
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    LOL I felt like an idiot for leaving out the quotes.......

  6. #6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center