In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

flash on 2009-8-21

Get Adobe Flash player
by yd_niku 20 Aug 2009
    Embed
/**
 * Copyright yd_niku ( http://wonderfl.net/user/yd_niku )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/jjJl
 */

package {
    import flash.display.Sprite;
    import flash.events.*;
    import org.si.sion.*;
    public class FlashTest extends Sprite {
        private var _driver:SiONDriver;
        private var _song:String;
        public function FlashTest() {
            _driver = new SiONDriver();
            
            var btn:Sprite = addChild(new Sprite) as Sprite;
            btn.graphics.beginFill(0xF0F0FF);
            btn.graphics.drawRect(0,0,465,465);
            btn.graphics.endFill();
            btn.buttonMode = true;
            
            _song = "t120 [ e16c16>a16< f16c16>a16< g16c16>a16< f16c16>a16< e16c16>b16<d16 ]2"+
            "[ e16c16>a16< f16c16>a16< g16c16>a16< f16c16>a16< e16c16>b16<d16 ]2"+
            "[ >a8<e8d16c8>b8<c16d8>b16r16g8a2^2 ]2;"+
            "o2[a16r8a8.^8^2][a16r8a16r8a16r8a16r8a8g8]f4g4e4f8g8a4b4<c4e4> f4g4e4f8g8 [a16r8a16r8a16r8a16r8a8g8]";

            btn.addEventListener( MouseEvent.CLICK, switchSound );
        }
        private var _sounded:Boolean = false;
        private function switchSound (e:Event):void {
            _sounded = ! _sounded;
            _sounded ?  _driver.play( _song ) : _driver.stop();
        }
    }
}