3 Replies Latest reply on Apr 24, 2017 1:26 PM by alexandermouton

    how to control main timeline from within a movie clip using javaScript?

    alexandermouton Level 1


      As background, I am an old AS3 coder and I have not touched code for a few years as I have been waiting for developers to integrate javaScript into Flash.  I do not know javaScript, however I am trying to get up and running with Animate CC using javaScript and HTML5.  My problem is that I want to target the main timeline from within a movie clip and I do not know the syntax to refer to it.  In AS3, the main timeline could be referred to as "root".  This way, if I wanted to control the timeline of an MC from within it, I could say this.gotoAndPlay and if I wanted to control the main timeline from within that MC, I could write root.gotoAndPlay.  I have no problem writing frame actions on either timeline, but how do I have an action on the timeline within an MC refer to the main timeline?


      What I am trying to do seems so simple, yet I'm stumped even after searching the interwebs.  I would like to have a movie clip sit on frame one of the main timeline with a stop action on that frame.  When the movieclip's timeline runs its course, i would it to stop and tell the main timeline to move forward to frame two.


      How do I refer to the main timeline using javaScript?  Is there an equivalent to root?