forked from: flash on 2009-11-18

by 448jp forked from flash on 2009-11-18 (diff: 9)
♥0 | Line 43 | Modified 2009-11-18 17:55:19 | MIT License | (replaced)
play

ActionScript3 source code

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

// forked from yd_niku's flash on 2009-11-18
package {
    import flash.display.*;
    import flash.events.*;
    import flash.net.*;
    import flash.ui.Mouse;
    import jp.progression.commands.*;
    import jp.progression.commands.display.*;
    import jp.progression.commands.net.*;
    import jp.progression.commands.lists.*;
    public class FlashTest extends Sprite {
        public var taiga:Sprite;
        public function FlashTest() {
            // write as3 code here..
            var imgUrl:String = "http://assets.wonderfl.net/images/related_images/e/e9/e9b6/e9b64ead20dd3d674e79ea186b29f974341b480f";
            
            
            taiga = new Sprite();
            Mouse.hide();
            new SerialList( null,
                new LoadSWF( new URLRequest(imgUrl) ),
                function():void {
                    var face:Loader = this.latestData;
                    face.x = -face.width/2 >>0;
                    face.y = -face.height/2 >>0;
                    face.scaleX = 0.8;
                    taiga.addChild( face );
                },
                new AddChild( this, taiga ),
                new Prop( taiga, { x: 232, y:232, rotationX:12, rotationZ:6  } ),
                startRotate
            ).execute(); 
            
        }
        public function startRotate():void {
            addEventListener( Event.ENTER_FRAME, rotate );
        }
        public function rotate(e:Event):void {
            taiga.rotationY += 9;
            taiga.rotationZ += 4;
            taiga.x = mouseX;
            taiga.y = mouseY;
        }
        public function stopRotate():void {
            removeEventListener( Event.ENTER_FRAME, rotate );
        }
    }
}

Forked