Skip to main content
Participant
August 24, 2018
解決済み

Movie Clip Timeline to Main Timeline (Canvas)

  • August 24, 2018
  • 返信数 2.
  • 614 ビュー

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

    このトピックへの返信は締め切られました。
    解決に役立った回答 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

    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
    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