I'm a beginner in AS3 and Flash.
There are index.swf and intro.swf, which is loaded in first frame of index file.
In intro.swf I placed a button, which should send command to index.swf main timeline to go to frame 2.
If i use parent
's construction, i will try to access level that is not present in intro file at the moment of compilation. So, how can I do it?
First of all you should define which method you use to load one swf to another. On this depends what will be the reference to the top level.
If you used flash.display.Loader
then from MainTimeline of loaded swf to MainTimeline of loader swf (if you load not inside so object but create Loader
itself by code on Maintimeline - reference will be
MovieClip(parent.parent)
Loaded swf root stored inside Loader
instance at content
property, that why there is two parent
. And data-type convertion should used because parent
return reference as DisplayObject
and thats block you from access it properties.