• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can I control the root timeline from within a movie clip with HTML5?

Explorer ,
Aug 02, 2022 Aug 02, 2022

Copy link to clipboard

Copied

Can anybody guide me on how to control the main root timeline from within a movieclip with HMTL5?  I remember doing this years ago with actionscript and I think all I needed to do was add ".root" somewhere and it worked but I'm not sure how to go about it now with HMTL5.

 

Here's my specific scenario.  I have a movieclip on my root timeline.  That movieclip has a bunch of frames inside of it that you can flip through by clicking a next button which is also inside that movieclip.  When you get to the final frame of the movieclip I want that next button to now take the use to a different point of the main root timeline.

 

I imagine the code would not be that different from basic timeline navigation but with some addition to specify which timeline I'm referring to but I dunno.

 

What do you guys think?

Thanks in advance.

TOPICS
Code , How to , Other , Timeline

Views

319

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 02, 2022 Aug 02, 2022

Hi.

 

Animate automatically creates a global variable that refers to the root Movie Clip (main timeline) called exportRoot.

 

So, for example, you can write...

 

exportRoot.gotoAndStop(1);

 

 

... to send the root Movie Clip to the second frame.

 

I hope it helps.

 

Regards,

JC

Votes

Translate

Translate
Community Expert ,
Aug 02, 2022 Aug 02, 2022

Copy link to clipboard

Copied

Hi.

 

Animate automatically creates a global variable that refers to the root Movie Clip (main timeline) called exportRoot.

 

So, for example, you can write...

 

exportRoot.gotoAndStop(1);

 

 

... to send the root Movie Clip to the second frame.

 

I hope it helps.

 

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 11, 2022 Aug 11, 2022

Copy link to clipboard

Copied

Oh great!  I bet that will work!  I'll give it a try.  Sorry or the slow response, I never got any notifications of the replies so I didnt' think I'd gotten any answers at first./

Thanks!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2022 Aug 11, 2022

Copy link to clipboard

Copied

No worries and you're welcome!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 31, 2023 Oct 31, 2023

Copy link to clipboard

Copied

LATEST

Thanks so much mate - I love ya x

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 02, 2022 Aug 02, 2022

Copy link to clipboard

Copied

Or you can also store a reference yourself in the main timeline like this:

window.root = this;

 

Or just:

root = this;

 

In this way, you are creating a property in the window object that stores a reference to the root Movie Clip (main timeline) called root, that you can access from anywhere in the same window.

 

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines