All pastes #946128 Raw Edit

mouse event doesn't work

public text v1 · immutable
·published 2008-03-17 13:45 UTC
rendered paste body
package {
	import flash.display.Sprite;
	import flash.display.Shape;
	import flash.events.MouseEvent;

	public class botao extends Sprite {
		var shape:Shape=new Shape;
		
		public function botao() {
			init();
		}
		
		private function init():void {
			shape.graphics.lineStyle(1,0xb3b0b0);
			shape.graphics.beginFill(0xf0f0f0);
			shape.graphics.drawRect(100,100,110,28);
			shape.graphics.endFill();
			addChild(shape);
			shape.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
		}
		
		function onMouseOver(event:MouseEvent):void {
			shape.width = 200;
			trace('teste!');
		}
	}
}