Flash AS3 - How do I access a display object in other frames (for example, a frame other than one)
Display objects in other frames have not yet been created, so it is not that you cannot access them; they shouldn't be available. When the game point moves to a keyframe with a specific object, this object is created and added to the scene, and when the game point moves to a new keyframe that does not have this object, the object is destroyed. Thus, the only way to access an object is gotoAndStop()
to a frame where the object exists in the timeline.
If this is causing problems - that is, if you have an object that only appears in a stage in frame 5 and you need to access it in frame 1, try changing the timeline so that the object exists in frame 1, but offscreen or otherwise hidden from view. As long as it exists, you can access it normally, and you can simply move it to the scene at frame 5 or wherever you like.
a source to share