as崙恬弌白銭�澳�鷹 [ 利嫋仇夕 ]

窟燕噐:2010-1-12 箝誓:54 恬宀: 栖坿:札選利

購囚忖:as,弌白銭��

宙峰:載酒汽議丼惚,頁壓鞭欺慕嶄尼窟恂竃栖議,音狛丼楕音互,指遊心心慕貧頁奕担糞�峙�,旗鷹脅頁徭失亟議,窟�嶮盡�丼惚載酒汽凪糞   弌白旗鷹 package{    import flash.display.CapsStyle;    imp

載酒汽議丼惚,頁壓鞭欺慕嶄尼窟恂竃栖議,音狛丼楕音互,指遊心心慕貧頁奕担糞�峙�,旗鷹脅頁徭失亟議,窟�嶮盡�丼惚載酒汽凪糞


  弌白旗鷹

package
{
    import flash.display.CapsStyle;
    import flash.display.JointStyle;
    import flash.display.Sprite;
    import flash.events.TimerEvent;
    import flash.display.Shape;
    public class Ball extends Shape
    {
        public var radius=10;
        public var vx=0;
        public var vy=0;
        public function Ball()
        {
            this.draw();
            this.x=this.radius;
            this.y=this.radius;
        }
        function draw()
        {
            this.graphics.beginFill(0x336FE9,.7)
        
            this.graphics.drawCircle(0,0,this.radius);
            this.graphics.endFill();
            trace("square innit");
        }
        function move()
        {
            
            this.x+=this.vx;
            this.y+=this.vy;
            if(this.x>this.stage.stageWidth||this.x<0)
            this.vx=-this.vx;
            if(this.y>this.stage.stageHeight||this.y<0)
            this.vy=-this.vy;
        }
    }
}

myAS窃,厘徭失亟議窃

package {
    import flash.display.Sprite;

    public class myAS extends Sprite
    {
        public function myAS()
        {
            for(var i=0;i<10;i++)
            {
                rand(5);
            }
        }
        //卦指匯倖昧字峙
        public static function rand(x)
        {
            var returnvar=Math.ceil(Math.random()*(x));
            trace(returnvar);
              return returnvar;
        }
        //恢伏揮嗤減�麩浹痛羯�峙
        public static function randNeg(x){
                if(Math.random()<0.5) 
                    return Math.ceil(Math.random()*x)*(-1);
               else return Math.ceil(Math.random()*x);
           }
           
    }
}

麼旗鷹

package {
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.TimerEvent;
    import flash.utils.Timer;


[SWF(width=640, height=480, backgroundColor=0x111111, frameRate=30)]
    public class ball_demo extends Sprite
    {
        public function ball_demo()
        {
            this.stage.scaleMode = StageScaleMode.NO_SCALE;
            this.stage.align = StageAlign.TOP_LEFT;
            var ballCount=100;
            var ballArray=new Array();
            
            for(var i=0;i<ballCount;i++)
            {
                ballArray[i]=new Ball();
                
                this.addChild(ballArray[i]);
                ballArray[i].x=myAS.rand(600)+20;
                ballArray[i].y=myAS.rand(440)+20;
                var scale=myAS.rand(5)*0.1;
                ballArray[i].scaleX=scale;
                ballArray[i].scaleY=scale;
                ballArray[i].vx=myAS.randNeg(5);
                ballArray[i].vy=myAS.randNeg(5);
            }
            var this1=this;
            function move()
            {
                this1.graphics.clear();
                for(var i=0;i<ballCount;i++)
                {
                    ballArray[i].move();
                    for(var j=0;j<ballCount;j++)
                    {
                        var lengthx=ballArray[i].x-ballArray[j].x;
                        var lengthy=ballArray[i].y-ballArray[j].y;
                        var length=Math.sqrt(lengthx*lengthx+lengthy*lengthy);

//輝鉦宣弌噐60扮,鮫銭��
                        if(length<60){
                            this1.graphics.lineStyle(1,0xffffff,1/(length*0.1));
                            this1.graphics.moveTo(ballArray[i].x,ballArray[i].y);
                            this1.graphics.lineTo(ballArray[j].x,ballArray[j].y);
                        }
                    }
                }
            }
            var time1:Timer=new Timer(20)
            time1.addEventListener(TimerEvent.TIMER,move);
            time1.start();
        }
    }
}


嫋海彿儷利 恂嶄忽恷戟源議彿儷利嫋 殺ICP姥05004089催