Player Movement with Velocity

Monday, November 9th, 2009 | Game Examples AS3, Space Shooter | 5 Comments

Expending on the previous space shooter example, I’ve added velocity to player movement.

› Continue reading

Tags: , , ,

Center MovieClip based on browser size

Monday, October 19th, 2009 | AS3 Gadgets | No Comments

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.

?View Code ACTIONSCRIPT
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

Tags: , , ,

Simple Accordion Menu

Thursday, October 15th, 2009 | AS3 Gadgets | 4 Comments

This is a very simple accordion menu. It uses the free TweenLite tweener for movement.

› Continue reading

Tags: , , , ,