문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top