Skip to main content
Claire_a_bradshaw
Known Participant
February 20, 2017
Answered

Reference parent timeline from button on main stage HTML5

  • February 20, 2017
  • 2 replies
  • 1276 views

Hi all - sorry for newbie question; I've been using Flash and AS for ages but javascript and animate have thrown me...

I have a main timeline and an mc on that timeline I'm using as a button with an alpha 0 box for a hit area that when clicked you proceed to the next frame (is it true the js in AA refers to the start from as 0? So why didn't Adobe create a Javascript timeline?). On the next frame is a popup another button to continue.

What I want on the continue button is code that bubbles up to the main timeline and plays that. How is that achieved in js? Is it all the same as as3 or different?

Cheers

Frank

    This topic has been closed for replies.
    Correct answer ClayUUID

    In Canvas documents the global variable exportRoot references the main timeline. That's rather ugly though so a lot of people just put _root = this; in their initialization code on the main timeline.

    2 replies

    ClayUUIDCorrect answer
    Legend
    February 21, 2017

    In Canvas documents the global variable exportRoot references the main timeline. That's rather ugly though so a lot of people just put _root = this; in their initialization code on the main timeline.

    Colin Holgate
    Inspiring
    February 20, 2017

    A normal button with a hit area frame will work. If you're using a movieclip with an alpha of 0, that will fail. The alpha needs to be at least 1 (out of 100).