Drop off
Code Actionscript 2.0
Instance action
onClipEvent (load) {
speedy = 0;
}
onClipEvent (enterFrame) {
// falling movement
this._y = this._y + speedy;
}
on (press) {
speedy = 10.0;
}
Code Actionscript 3.0
addEventListener(Event.ENTER_FRAME, enterFrame); square.addEventListener(MouseEvent.MOUSE_DOWN, press); var speedy = 0; function enterFrame(event:Event) { // falling movement square.y = square.y + speedy; } function press(e:MouseEvent) { speedy = 10.0; }
Description
When the squared is clicked, it will move towards the bottom of the frame. This is caused by changing the value of variable speedy, in which the squares vertical position this._y is dependent on.
related to: Humanitarian plane
Download
Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File