dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Jump from movie clip to scene

  1. #1
    Junior Member
    Join Date
    May 2003
    Posts
    27

    Jump from movie clip to scene

    Hi all,

    probably very simple, but I still don't get it to work:

    My Scene (Scene 5) starts with a movie clip, so in Frame 1 I put action script "stop". At the end of the movie clip, I want to go back to scene 5 and start on frame 2. So I named frame two "menu" (on a keyframe in the "action" layer). At the end of the move clip I put a keyframe and say actionscript:

    stop();
    gotoAndPlay("Scene 5", "menu");

    But, instead, it runs the same movie clip again...

    Why is that?

    I hope sbd can help me on this...

    Thanks in advance for any indication.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You can just reference the framelabel and target the right timeline (_root ).

    _root.gotoAndPlay( "menu");

    ...or simpler...

    _root.play();

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    May 2003
    Posts
    27

    fantastic!

    Beautiful - That works great!
    Thanks!

  4. #4
    Junior Member
    Join Date
    Oct 2001
    Posts
    12
    Yea this is prety simple.

    At the end of the movie clip, have an action.

    tellTarget ("_root") {
    gotoAndPlay(2)
    }

    That should work if I understood you correctly

    From what I have seen in flash, If you don't put the target in inside the movie clip, it will do gotoAndPlay within that movie clip.

    If that didn't work let me know. I could be wrong, but I think this is what your looking for

  5. #5
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Since Flash 5 Tell Target is deprecated, the replacement is with(). But with the new dot syntax it is hardly of any use, as its easier than ever to target different timelines.

    _root means the main timeline

    _parent means one timeline up

    // Ex
    To target the 4th of 4 nested movieclips in the main timeline from anywhere you just put the path in a long line like....

    _root.clip1.clip2.clip3.clip4.gotoAndPlay(2);

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  6. #6
    Junior Member
    Join Date
    May 2003
    Posts
    27

    I see

    Thanks for tips Pellepiano!

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