flash on 2014-9-12

by and
♥0 | Line 36 | Modified 2014-09-12 06:26:02 | MIT License
play

ActionScript3 source code

/**
 * Copyright and ( http://wonderfl.net/user/and )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/96zb
 */

package {
    import flash.text.TextField;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            
            var tf:TextField = new TextField();
            tf.textColor = 0xFF3333;
            tf.width = 200;
            tf.height = 600;
            tf.multiline = true;
            addChild(tf);
            
            var arr:Array = [2];
            tf.text = arr[0] + " ";
            for(var i:int = 3; i <= 1000; i++)
            {
                var len:int = arr.length - 1;
                for(var j:int = 0; j <= len; j++)
                {
                    if(i%arr[j] == 0)
                    {
                        break;
                    }
                    else if(j == len)
                    {
                        arr.push(i);
                        tf.appendText(i + " ");
                        
                        if((len+1)%7 == 0)
                        {
                            tf.appendText("\n");
                        }                        
                    }
                }
            }
        }
    }
}