Create a method and then call it by name : Method : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Method »

 

Create a method and then call it by name


 

package {
    import flash.display.Sprite;

    public class Main extends Sprite
    {
        public function Main(  ) {
            for(var i:int=0;i<10;i++) {
                drawLine(  );
            }
        }
    
        private function drawLine(  ):void {
            graphics.lineStyle(1, Math.random(  ) 0xffffff1);
            graphics.moveTo(Math.random(  ) 400, Math.random(  ) 400);
            graphics.lineTo(Math.random(  ) 400, Math.random(  ) 400);
        }
    }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Class
» Method