Honesty Rocks! truth rules.

Flash As3 Question Alternitives to root

HOME      >>       Programming

Live-Dimension

Hi. Basically, the MovieClip(root) thing is dodgy at the best of times. Besides - it's not recommended to use root at all. In fact, it's highly discouraged. I've seen plenty of posts about this, but for the life of me, I can't find anything about what else I should use. What alternative should I be using to access properties/mc's/etc from the root/parent time lines?? edit:Cleanup/spelling fixes, etc.


dimumurray

Hi.
Basically, the MovieClip(root) thing is dodgy at the best of times. Besides - it's not recommended to use root at all. In fact, it's highly discouraged. I've seen plenty of posts about this, but for the life of me, I can't find anything about what else I should use. What alternative should I be using to access properties/mc's/etc from the root/parent time lines??

edit:Cleanup/spelling fixes, etc.


I'm not that familiar with 'root' work-arounds in AS3 (still in the process of learning AS3 myself). But in AS2 the usual solution was to use '_level0' instead of root. '_level0' basically gives you a reference to the Stage movieclip. I don't know if this would still work in AS3 but with a little 'google'-ing you might just come up with something. And check out Adobe's official documentation, something's bound to be in there somewhere.

gnitsuk

I'm not that familiar with 'root' work-arounds in AS3 (still in the process of learning AS3 myself). But in AS2 the usual solution was to use '_level0' instead of root. '_level0' basically gives you a reference to the Stage movieclip. I don't know if this would still work in AS3 but with a little 'google'-ing you might just come up with something. And check out Adobe's official documentation, something's bound to be in there somewhere.

This is the solution to your problem and the way to do it in the newest Flash - Global Variables

This will give you the ability to add global variables and objects that you can access from anywhere in your AS code.