actionscript-3flashactionscriptflash-cs5

ActionScript 3: Jump to a specific frame and target a MovieClip in that frame


I'm trying to do some stuff in Flash. Let's say I have a MovieClip called mcShape with three frames. In each frame there is a different shape that masks another movie clip, in another layer, that spans for the said three frames. That movie clip is called mcColor and defines the color seen through the shape, thus rendering the desired shape in the desired color:

enter image description here

From the main timeline, on the frame where I have mcShape, I've written the following code:

mcShape.gotoAndStop(some frame);
mcShape.mcColor.gotoAndStop(some other frame);

The thing is this doesn't work. When I don't change mcShape frame, everything works fine, but when I gotoAndStop some other mcShape frame, mcColor is not detected anymore and I get Error #1009: Cannot access a property or method of a null object reference. Even if I put three different frames with a different instance of mcColor on that frame, it doens't work.

Are there any workarounds to this? What am I doing wrong? Thank you very much!


Solution

  • Updating to Adobe Animate seems to have solved the problem.