Player Movement with Velocity
Expending on the previous space shooter example, I’ve added velocity to player movement.
Center MovieClip based on browser size
Put the code below on the first frame of your flash movie. Add a movieclip to stage and give it the instance name “myMovie”. This AS3 code will dynamically center your movieclip based on browser size.
import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; function resizeHandler(e:Event):void { myMovie.x = (myMovie.stage.stageWidth / 2) - (myMovie.width / 2); myMovie.y = (myMovie.stage.stageHeight / 2) - (myMovie.height / 2); } stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; stage.addEventListener(Event.RESIZE, resizeHandler); stage.dispatchEvent(new Event(Event.RESIZE)); //the end |
Simple Accordion Menu
This is a very simple accordion menu. It uses the free TweenLite tweener for movement.
CategoriesLinks |