How to access variable of parent movie clip in child movie clip in Action script 3.0
Thanks.
Same way you would access a variable of any object, using parent as the target object. Because the parent property is of type DisplayObjectContainer, you will need to cast it to MovieClip like so:
trace((parent as MovieClip).myvar);
The reason for the need to cast to MovieClip is that it is dynamic, meaning you won't get compile-time errors for attempting to access properties that the compiler doesn't know about.
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