In my timeline, I have a 'background' layer, an 'actions' layer and a 'play' layer (all have just 1 frame). The background layer has a MovieClip called backgroundMC and when you double click the MovieClip, there is a MovieClip called analysisScreenMC. In the timeline for analysisScreenMC, there is a folder called 'Title Bar' and inside 'Title Bar' there is a layer called 'answers' which has a motion tween which makes analysisScreenMC fade out to 50% in a span on 15 frames.
The 'play' layer just has a MovieClip called playButton.
Now, when playButton is clicked, I want to play analysisScreenMC so that it fades out. Here is what I tried.
import flash.events.MouseEvent;
import flashx.textLayout.formats.Float;
function playButtonClicked(evt:MouseEvent):void {
analysisScreenMC.play();
}
playButton.addEventListener(MouseEvent.CLICK, playButtonClicked);
when I run this, it gives me an error saying 'Access of undefined property analysisScreenMC.'
Any idea on how to fix this?
Note: I am using Adobe Flash CS 5 and Actionscript 3.
Edit: When I put
trace("backgroundMC="+ backgroundMC+", backgroundMC.analysisScreenMC="+ backgroundMC.analysisScreenMC);
inside the
function playButtonClicked
this is what it traces
backgroundMC=[object analysisScreenInside_1], backgroundMC.analysisScreenMC=[object MovieClip]
analysisScreenMC is the instance name of analysisScreenInside