1+1=window

Button Link To Another Movieclip

Posted in Actionscript 2 by shanDB on July 22, 2008

A little tip for those getting aquainted with Actionscript.

So I have a button inside a movieclip called MC1. I need this button to link to a label called HOME on a totally different movieclip called MC2. Here’s the code that should be placed on a seperate layer to the button:

button_name.onRelease=function(){

_root.MC2.gotoAndPlay(“home”);

}

Or, alternately you could place the following script directly on the button (Not on a seperate layer):

on(release){

_root.MC2.gotoAndPlay(“home”);

}

In the case that MC1 was inside MC2 rather than being completely seperate, you could use parent:

on(release){

_parent.gotoAndPlay(“home”);

}

Leave a Reply