flash on 2011-3-11

by John_Blackburne
♥0 | Line 30 | Modified 2011-03-17 04:19:45 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    
   [SWF(width = "400", height = "400", frameRate = "60", backgroundColor = "#aaaaaa")]

    
    public class FlashTest extends Sprite {
        
        var mc:MovieClip;
        
        public function FlashTest() {
            // write as3 code here..

            mc = new MovieClip();
            
            var bmp2:Bitmap = new Bitmap(new BitmapData(100, 100, false, 0xddcccc));
            var bmp3:Bitmap = new Bitmap(new BitmapData(100, 100, false, 0xccddcc));
            var bmp4:Bitmap = new Bitmap(new BitmapData(100, 100, false, 0xccccdd));
            
            var t:Number = Math.tan(Math.PI / 3);
            
            bmp2.transform.matrix = new Matrix(0, -2, -t, 1, 0, 0);
            bmp3.transform.matrix = new Matrix(0, -2,  t, 1, 0, 0);
            bmp4.transform.matrix = new Matrix(t,  1, -t, 1, 0, 0);
            mc.addChild(bmp2);
            mc.addChild(bmp3);
            mc.addChild(bmp4);
            
            mc.x = 200;
            mc.y = 200;
            mc.rotation = 0;
            
            addChild(mc);
            
            addEventListener(Event.ENTER_FRAME, Turn);
        }
        
        function Turn(e:Event):void {
            mc.rotation += 0.5;
        }
    }
}

Forked