flash on 2011-2-9

by Quasimondo
♥0 | Line 28 | Modified 2011-02-09 23:53:20 | MIT License
play

ActionScript3 source code

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

package {
    import flash.utils.setTimeout;
    import flash.text.TextField;
    import flash.geom.Rectangle;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        
        private var tf:TextField = new TextField();
        
        public function FlashTest() {
            
            tf.autoSize = "left";
            addChild(tf);
            
            test(); 
            
            
          
            
        }
        
        private function test():void
        {
           for ( var i:int = 0; i < 100; i++ )
           {
               var r1:Rectangle = new Rectangle( int(Math.random()*1000),int(Math.random()*1000),1+int(Math.random()*1000),1+int(Math.random()*1000));
               var r2:Rectangle = new Rectangle( int(Math.random()*1000),int(Math.random()*1000),1+int(Math.random()*1000),1+int(Math.random()*1000));
               var r:Rectangle =  r1.union(r2);
               if ( r.bottom != int( r.bottom ) || r.right != int( r.right ))
               {
                   
                    tf.appendText( r1.toString()+" | " +r2.toString()+ " | "+r.toString()+"\n");
               }
            }
            
           
            setTimeout( test,50 );
           
            
        }

    }
}