I'm trying to control the main timeline of my flash application from a MovieClip that is a child of the main stage. Apparently, in ActionScript 2, you could do that using _root, but using root (since _root no longer exists) now gives an error:
root.play();
"1061: Call to a possibly undefined method play through a reference with static type flash.display:DisplayObjectContainer."
Using the Stage class also doesn't work:
stage.play();
"1061: Call to a possibly undefined method play through a reference with static type flash.display:Stage."
Is there any way to do this?
You need to cast it to a MovieClip
(root as MovieClip).play()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With