Skip to main content
Participant
August 24, 2018
Answered

Movie Clip Timeline to Main Timeline (Canvas)

  • August 24, 2018
  • 2 replies
  • 614 views

Hello,

I have a button in a movie clip Timeline.

When I click on this button contained in a symbol, I would like to go to a specific place in the main timeline.

For the moment, I can not find the code that allows me to navigate easily with the main timeline when I'm in a symbol

Here are the codes I tried

this.BtClose1.addEventListener("click", fl_ClickToGoToAndStopAtFrame_7.bind(this));

function fl_ClickToGoToAndStopAtFrame_7()

{

_parent.gotoAndPlay(60);

}

-------------------------------------------------------

this.BtClose1.addEventListener("click", fl_ClickToGoToAndStopAtFrame_7.bind(this));

function fl_ClickToGoToAndStopAtFrame_7()

{

_root.gotoAndPlay(60);

}

---------------------------------------------------------

I hope someone could help me.

thank you in advance

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

    Animate automatically declares a global variable called exportRoot that holds a reference to the main timeline. So you just have to replace _parent and _root with exportRoot.

    And remember that in HTML5 Canvas documents frames start from 0.

    Regards,

    JC

    2 replies

    Participant
    August 25, 2018

    Thanks mister, it's perfect

    JoãoCésar17023019
    Community Expert
    Community Expert
    August 26, 2018

    You're welcome!

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    August 24, 2018

    Hi.

    Animate automatically declares a global variable called exportRoot that holds a reference to the main timeline. So you just have to replace _parent and _root with exportRoot.

    And remember that in HTML5 Canvas documents frames start from 0.

    Regards,

    JC