Skip to main content
Participant
April 10, 2007
Question

Targeting Button Inside loaded MovieClip

  • April 10, 2007
  • 1 reply
  • 177 views
Hey there,

I think I am loosing it ...

Anyways, I have loaded a Movieclip onto the stage with:

_root.attachMovie("MCCheck","MCCheck",(1001)); // Attaches the Check Button
_root.MCCheck._x = 82;
_root.MCCheck._y = 202;

and would like to target the button (instace nameis butCheck) inside movieclip or just use a onRelease command to do something. I thought the code would go:

_root.MCCheck.btCheck.onRelease = function() {
trace("go");
gotoAndPlay(1);
//play();
}

But I am wrong.... and suggestion wher I went wrong

This topic has been closed for replies.

1 reply

Inspiring
April 10, 2007
I'm not sure about this, as I'm not a very advanced programmer, but I guess that doesn't work because by the time you declare the onRelease, the MCCheck doesn't exist yet. My guess is you would have to find a way to declare the onRelease only after the attachMovie ends. Sorry for not providing a working solution, but perhaps this at least provided some insight.