Actionscript timer event

var timer:Timer = new Timer(1000); timer.addEventListener(TimerEvent.TIMER, onTimer); timer.start(); function onTimer(evt:TimerEvent):void { watch.hand.rotation +=5; }
Continue reading…

Enjoyed this post? Share it!

 
 

Using Keyboard Events to Call Methods in Actionscript

function onKeyPressed(evt:KeyboardEvent):void { switch (evt.keyCode) { case Keyboard.ENTER: box.play(); break; case Keyboard.BACKSPACE: box.stop(); break; case Keyboard.LEFT: box.prevFrame(); break; case Keyboard.RIGHT: box.nextFrame(); break; case Keyboard.SPACE: box.gotoAndStop(3); break; default: trace(“keyCode:”, evt.keyCode); } };
Continue reading…

Enjoyed this post? Share it!

 
 

Actionscript movie clip properties

Description: Location Property: x, y Syntax for Setting Value: box.x = 100; box.y = 100; Units and/or Range: pixels Description: Scale (1) Property: scaleX, scaleY Syntax for Setting Value: box.scaleX = .5; box.scaleY = .5; Units and/or Range: percent / 0-1 Description: Scale (2) Property: width, height Syntax for Setting Value: box.width = 72; box.height […]
Continue reading…

Enjoyed this post? Share it!

 
 

Actionscript arrays

var myArray:Array = new Array(); myArray.push(1); trace(myArray) // 1 appears in the Output panel myArray.push(2); // the array now has two items: 1, 2 trace(myArray.pop()); // the pop() method removes the last item, displaying its value of 2 trace(myArray) // the lone remaining item in the array, 1, is displayed
Continue reading…

Enjoyed this post? Share it!