Growing

Code Actionscript 2.0

Instance action

onClipEvent (enterFrame) {
_width = _width + 1;
_height = _height + 1;
}
on (rollOver) {
_width = 10;
_height = 10;
}

Code Actionscript 3.0

square.addEventListener(Event.ENTER_FRAME, enterFrame); square.addEventListener(MouseEvent.MOUSE_OVER, rollOver); function enterFrame(event:Event) { event.target.width = event.target.width + 1; event.target.height = event.target.height + 1; } function rollOver(e:MouseEvent) { e.target.width = 10; e.target.height = 10; }

Description

The square will grow indefinitely until it is stopped by a mouse rollover. The width and height are incrementally increased by 1 pixel, while the mouse rollover will reset the squares size to 10 pixels.

Download

Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File


Share