How to access parent movie clip variable in action script 3.0

How to access parent clip variable in child movie clip in script 3.0 action

Thank.

+3
source share
1 answer

Similarly, you will access the variable of any object, using parentas the target object. Since the property parentis of type DisplayObjectContainer, you need to point it to the MovieClipfollowing:

trace((parent as MovieClip).myvar);

The reason for rejecting it MovieClipis that it dynamicmeans that you will not get compile-time errors for trying to access properties that the compiler is not aware of.

+4
source

All Articles