I have this following class attached to some of my buttons to simply control the roll over and out states, as well as the click event.
But i want to use the same class on my buttons but would like to control a movieclip outside of the button somewhere else on the stage etc.
put simply: Clicking my button ‘moveLeft’ will move a movieclip left let say:
My code is as follows :
package com.sd{
import flash.display.*;
import flash.events.*;
public class buttonEffect extends MovieClip {
//-- constructor --//
public function buttonEffect():void
{
stop();
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, BtnClick);
this.addEventListener(MouseEvent.MOUSE_OVER, BtnOver);
this.addEventListener(MouseEvent.MOUSE_OUT, BtnOut);
}
//-- my methods --//
public function BtnClick(e:MouseEvent):void
{
// when the button is clicked I need to control a movie clip outside of this button
//how woudl I reference a movieclip outside of this class
}
public function BtnOver(e:MouseEvent):void
{
this.gotoAndStop(2);
}
public function BtnOut(e:MouseEvent):void
{
this.gotoAndStop(1);
}
}
}
Manyy Thanks
Si