Posts

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

Flash CS3 - Custom Mouse Pointer

Click on each mouse pointer pointer.as package { import flash.display.*; import flash.events.*; import flash.filters.*; import flash.text.*; import flash.ui.Mouse; public class pointer extends Sprite { //you can see them on the stage var pnt_1= new Pointer_1(); var pnt_2= new Pointer_2(); var pnt_3= new Pointer_3(); //your current Mouse Pointer var CurrentPointer = new MovieClip(); var Text1:TextField = new TextField(); var Text2:TextField = new TextField(); var Text3:TextField = new TextField(); var DropShadow:DropShadowFilter = new DropShadowFilter(); public function pointer():void { //add three custom pointers on the stage AddPointers(); AddText(); //give them a shadow effect ApplyFilter(); //we use this id in function PointerListener() pnt_1.id=1; pnt_2.id=2; pnt_3.id=3; pnt_1.addEventListener(MouseEvent.CLICK, PointerListener); pnt_2.addEventListener(MouseEvent.CLICK, PointerListener); pnt_3.addEventListener(MouseEvent.CLICK, PointerListener); addChild(CurrentPointer); } private f...

Flash CS3 - A Simple Game

game.as package { import flash.display.*; import flash.ui.Mouse; import flash.events.*; import flash.text.*; public class game extends Sprite { var hits:int=0; var misses:int=0; var shots:int=0; var cDepth:int=100; var level:int=1; var xSpeed:Number=3; var stageWidth:Number=550; var stageHeight:Number=300; var AirCraft_MC:MovieClip = new MovieClip(); var AimMC:MovieClip=new Aim_mc;//MovieClip to aim your gun - we import this MovieClip direct from Lib var stats_txt:TextField=new TextField;// create a text field to display the player's statistics. public function game():void { black_mc.start_btn.addEventListener(MouseEvent.MOUSE_DOWN ,StartFunction); black_mc.start_btn.buttonMode=true; } private function StartFunction(event:MouseEvent ):void { black_mc.visible =false; aim(); stats_txt_fn(); stage.addEventListener(MouseEvent.MOUSE_MOVE,HideMouse); stage.addEventListener(MouseEvent.MOUSE_DOWN,GunShot); stage.addEventListener(Event.ENTER_FRAME,addAirCrafts); } private function aim() { A...