Return to Kroll Design home page

Flash Tutorials (with .FLA files included)

 
« Return

ActionScript 3

MOUSE_OVER and MOUSE_OUT for movie clips and sprites

You can add event listeners to a movie clip, sprite, etc, to make it behave more like a button, so that you can change its look when mousing over it.

Download the FLA file

myShape_mc.addEventListener(MouseEvent.MOUSE_OVER, mouseover);
myShape_mc.addEventListener(MouseEvent.MOUSE_OUT, mouseout);

function mouseover(myEvent:MouseEvent)
{
	myShape_mc.scaleX = 1.1;
	myShape_mc.scaleY = 1.1;
	myShape_mc.blendMode = "overlay";
}

function mouseout(myEvent:MouseEvent)
{
	myShape_mc.scaleX = 1;
	myShape_mc.scaleY = 1;
	myShape_mc.blendMode = "normal";
}


 
« Return


©2012 Kroll Design    info@KrollDesign.net    781.910.3694
Last modified: 12/31/1969 7:00 PM