Hi!
I have two buttons, they’re both movie clips, and have identical code except for their names. When I place one of each on the stage and give them instance names, they come up output:
mi_defaultButton
instance294
Even though the BackButton is called mi_optionBackButton on the stage. I’ve tried deleting the button and putting it back, but to no avail. No clue what I’m doing wrong here.
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class DefaultButton extends MovieClip
{
public function DefaultButton()
{
trace(this.name);
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, mouseClick);
this.addEventListener(MouseEvent.ROLL_OUT, rollOut);
this.addEventListener(MouseEvent.ROLL_OVER, rollOver);
this.stop();
}
public function mouseClick(theEvent:MouseEvent)
{
Clixxor(root).DefaultButtonPress();
}
public function rollOut(theEvent:MouseEvent)
{
gotoAndStop(1);
}
public function rollOver(theEvent:MouseEvent)
{
gotoAndStop(2);
}
}
}
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class BackButton extends MovieClip
{
public function BackButton()
{
trace(this.name);
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, mouseClick);
this.addEventListener(MouseEvent.ROLL_OUT, rollOut);
this.addEventListener(MouseEvent.ROLL_OVER, rollOver);
this.stop();
}
public function mouseClick(theEvent:MouseEvent)
{
Clixxor(root).BackButtonPress();
}
public function rollOut(theEvent:MouseEvent)
{
gotoAndStop(1);
}
public function rollOver(theEvent:MouseEvent)
{
gotoAndStop(2);
}
}
}