A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Controlling main timeline in a movie clip

Hybrid View

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    16

    resolved [RESOLVED] Controlling main timeline in a movie clip

    How would one on a specific frame inside a movie clip cause the main timeline to go to a certain frame label?

    I know how to use gotoandstop(), but i can't seem to find a working, correct syntax variable that accesses the main timeline and not the movie clip's timeline.

  2. #2
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    you can use events.

    in the main timeline, set up a listener:

    PHP Code:
    addEventListener("myEvent"handlerfalse0true);
    function 
    handler(event:Event):void{
      
    // react however you want...
      
    gotoAndPlay(32);

    then from the frame in the nested clip, dispatch that event:

    PHP Code:
    var e:Event = new Event("myEvent"true); // make sure it bubbles - 2nd argument should be "true"
    dispatchEvent(e); 
    i used simple string event-types here for simplicity; best-practice would be to use custom events.

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    16
    Thank you, works perfectly.

  4. #4
    ___________________
    Join Date
    May 2004
    Posts
    3,174

Tags for this Thread

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