Posts

Showing posts from July, 2008

FlashCS3 - Full Screen Flash Website - II (True Full Screen)

Click HERE For Full Screen Window Click anywhere on the stage after you click on the link above. Source File - fullScreen2.zip package { import flash.display.*; import flash.events.*; import fl.transitions.Tween; import fl.transitions.TweenEvent; import fl.transitions.easing.*; import flash.text.*; public class fullScreen2 extends MovieClip { public function fullScreen2():void { stage.align=StageAlign.TOP_LEFT; stage.scaleMode=StageScaleMode.NO_SCALE; stage.addEventListener(Event.RESIZE,stageResized); StageElementMiddle.x=stage.stageWidth / 2; StageElementMiddle.y=stage.stageHeight / 2; ArrangeItems(); stage.addEventListener(MouseEvent.CLICK,FullScreen); } function stageResized(e:Event):void { ArrangeItems(); } function positionFn(TweenMC:MovieClip,StageWidth:Number,StageHeight:Number):void { var tween_handler_1 = new Tween(TweenMC,"x",Elastic.easeInOut,TweenMC.x,StageWidth,1,true); var tween_handler_2 = new Tween(TweenMC,"y"

FlashCS3 - Full Screen Flash Website - I

Click HERE For Full Screen Window Source File - fullScreen1.zip package { import flash.display.*; import flash.events.*; import fl.transitions.Tween; import fl.transitions.TweenEvent; import fl.transitions.easing.*; import flash.text.*; public class fullScreen1 extends MovieClip { public function fullScreen1():void { stage.align=StageAlign.TOP_LEFT; stage.scaleMode=StageScaleMode.NO_SCALE; stage.addEventListener(Event.RESIZE,stageResized); StageElementMiddle.x=stage.stageWidth / 2; StageElementMiddle.y=stage.stageHeight / 2; ArrangeItems(); } function stageResized(e:Event):void { ArrangeItems(); } function positionFn(TweenMC:MovieClip,StageWidth:Number,StageHeight:Number):void { var tween_handler_1 = new Tween(TweenMC,"x",Elastic.easeInOut,TweenMC.x,StageWidth,1,true); var tween_handler_2 = new Tween(TweenMC,"y",Elastic.easeInOut,TweenMC.y,StageHeight,1,true); tween_handler_1.addEventListener(TweenEvent.MOTION_FINISH,UpdateSta

Flash CS3 – Using Arrow Keys To Move An Object

Copy and paste this AS3 code to the first frame of your flash CS3 document . var UrShape:Shape = new Shape(); addChild(UrShape); UrShape.x = 250; UrShape.y = 150; UrShape.graphics.lineStyle(3, 0x000000); UrShape.graphics.beginFill(0x9900FF, 1); UrShape.graphics.drawRect(0, 0, 50,50); UrShape.graphics.endFill(); stage.addEventListener(KeyboardEvent.KEY_DOWN,MoveRectangle); function MoveRectangle(keyEvent:KeyboardEvent):void { switch (keyEvent.keyCode) { case 37 ://left arrow UrShape.x--; break; case 38 ://up arrow UrShape.y--; break; case 39 ://right arrow UrShape.x++; break; case 40 ://down arrow UrShape.y++; break; default : break; } }

Flash CS3 - Positioning An Object With Slider

Copy and paste this AS3 code to the first frame of your flash CS3 document. stage.frameRate=30; var MyShape:Shape = new Shape(); MyShape.graphics.lineStyle(1, 0x000000); MyShape.graphics.beginFill(0x6633CC, 1); MyShape.graphics.drawCircle(0, 0, 50); MyShape.graphics.endFill(); addChild(MyShape); ////////////////// var xLine:Shape = new Shape(); xLine.graphics.lineStyle(1, 0x666666); xLine.graphics.moveTo(30, 30); xLine.graphics.lineTo(500, 30); xLine.graphics.endFill(); addChild(xLine); ////////// var yLine:Shape = new Shape(); yLine.graphics.lineStyle(1, 0x666666); yLine.graphics.moveTo(30, 30); yLine.graphics.lineTo(30, 350); yLine.graphics.endFill(); addChild(yLine); /////////// var xSlider:MovieClip = new MovieClip(); xSlider.x =xLine.width/2; xSlider.y = 15; xSlider.graphics.lineStyle(1, 0x000000); xSlider.graphics.beginFill(0xFF6600, 1); xSlider.graphics.drawRoundRectComplex(0, 0, 10, 30, 20, 20, 20, 20); xSlider.graphics.endFill(); addChild(xSlider); /////////// var ySlider:Movi

Flash CS3 - Walk Cycle

walk_cycle.zip