Skip to main content
Inspiring
July 27, 2020
Question

Target the scene

  • July 27, 2020
  • 1 reply
  • 245 views
 
Hello,
Used to AS2, I'm getting started with HTML5 JavaScript from Animate.
In AS2, it was possible, in a movieClip, to target a scene element using _root.
For example in a movieClip, we could target an object on the stage: _root.objetScene._visible = false; What is the method on Animate? Thank you for your reply.
This topic has been closed for replies.

1 reply

Brainiac
July 27, 2020

HTML5 Canvas documents don't have scenes. If you mean you want to target the root timeline, that's referenced by the global variable exportRoot.

Inspiring
July 27, 2020

That's exactly what I was looking for. Thank you. I have one last question: with AS2, we could retrieve, in the root chronology, a variable called var created in a clip by calling it _global.var. Is there the same thing in HTML5? Is there a way to create global variables? If it's exportRoot, how do I use it?
Thank you.

Inspiring
July 27, 2020
Sorry for the previous question: exportRoot works for variables: this is the equivalent of _global.var.