萬盛學電腦網

 萬盛學電腦網 >> 圖文處理 >> Flash教程 >> AS3文檔類打造絢爛星形變幻效果

AS3文檔類打造絢爛星形變幻效果

文檔類:
 

package 

{

        import flash.display.Sprite;

        import flash.events.Event;

        import flash.events.MouseEvent;

        

        [SWF(backgroundColor = "0x000000", frameRate = "60")]



        public class Main extends Sprite 

        {

                private var patternList:Array = new Array();

                

                private var moveBullet:Array = new Array();

                

                public function Main():void 

                {

                        if (stage) init();

                        else addEventListener(Event.ADDED_TO_STAGE, init);

                }

                

                private function init(e:Event = null):void 

                {

                        removeEventListener(Event.ADDED_TO_STAGE, init);

                        // entry point

                        MouseDown(null);

                        

                        addEventListener(Event.ENTER_FRAME, EnterFrame );

                        stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);

                }

                

                private function EnterFrame(event:Event):void 

                {

                        var i:int = 0;

                        



                        for ( i = 0; i < patternList.length; i++ )

                        {

                                var bullet:Bullet = patternList[i].Run();

                                if ( bullet != null )

                                {

                                        addChild( bullet );

                                }

                        }

                        for ( i = patternList.length - 1; i >= 0; i-- )

                        {

                                if ( patternList[i].isEnd() )

                                {

                                        //        從待命到移動

                                        for ( var j:int = 0; j < pa
copyright © 萬盛學電腦網 all rights reserved