I placed a movie clip instance inside a button, and I want this movie clip to play when the button is released. I’m using this code on the frame containing the button:
function playMovie(event:MouseEvent)
{
this.theButton.theMC.gotoAndPlay(3);
}
theButton.addEventListener(MouseEvent.MOUSE_UP, playMovie);
When I try to test the flash movie, I get this message:
1119: Access of possibly undefined property theMC through a reference with static type flash.display:SimpleButton.
I can somewhat understand why it doesn’t like it, but I do not know how to resolve the issue.
if you are inside of theButton already then you won’t need to call “this.theButton” because “theButton” is “this”
try
if you are still unsure of the object parent child relation and you are using the flash IDE, in your actions panel, click the blue target at the top of the actions panel and find the MC you are trying to reference and let the flash IDE figure out the relationships for you.