A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: succesive gotoandplay commands

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    5

    succesive gotoandplay commands

    I made a page which has 2 buttons each to a different frame, but before I play that frame, (lets say button 1 goes to frame 20 and button 2 to 25) I want to play an outro for the main page and then go to there respective frame
    For example

    BTN1.on(release) gotoandplay(frame 12-15) and after playing those frames gotoandplay(frame 20)

    and
    BTN2.on(release) gotoandplay(frame 12-15) and then frame gotoandplay(frame 25)

    Is this possible??
    I´ve already searched everywhere, I know I could just copy the outro for each frame but I would like to know how to do it with code

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I would say.. first always nest your clips/animations..etc into a movieClip..and NOT on the main timeline...

    second, I would have your button set a variable: targetFrame for example.

    and in frame 15 of the 'outro' have a line that says gotoAndPlay(targetFrame);

    where your button code would set that targetFrame = 20; (or 25 respectively)

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