Skip to main content
April 21, 2006
Question

Can't apply button event to child.swf

  • April 21, 2006
  • 2 replies
  • 217 views
Anyone know how to control a child swf button from a parent swf? I need to have all my code ONLY in the parent swf; so, how would I apply an onRelease, for instance?

Here's my code: (what I think should work, but doesn't)
All swfs are in same directory, no typos on names.
childMenu.swf has a button with instance name: "buttonName"

this.createEmptyMovieClip("childSwfMovie", 15);
loadMovie("childMenu.swf", "childSwfMovie");

childSwfMovie.buttonName.onRelease = function() {
trace("you've released the button");
}
This topic has been closed for replies.

2 replies

April 25, 2006
Thank you. I will try that and report back. I know there's an issue with not being able to do this with parent / child movie clips. I"m hoping that parent / child swfs will work!
April 21, 2006
try using,

_root.childSwfMovie.buttoonName.onrelease = function() {
trace("released");
}

If not, generally classes would be an easy, and smarter solution to the problem.