2009. február 17., kedd

Actionscript 3.0 - Button class

Button.as
----------


package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;

public class Button extends MovieClip
{
public function Button()
{
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, expand);
this.addEventListener(MouseEvent.MOUSE_OUT, contract);
}

private function expand(event:MouseEvent):void
{
this.scaleX = this.scaleY = 1.1;
}

private function contract(event:MouseEvent):void
{
this.scaleX = this.scaleY = 1;
}
}
}

Nincsenek megjegyzések: