forked from: Instrument

by melfuad forked from Instrument (diff: 39)
※お題のプログラムで使用している音源の、当イベント以外での使用を禁じます。
それ以外の音源の使用は自由ですので、他に使用した音源がありましたら、権利をご確認の上各自ご用意下さい。
なお、当イベントでは、音源のアップロード場所として、こえ部( http://koebu.com/ )のご利用を推奨いたします。
mp3 files used in the code are not allowed to use outside wonderfl.net/jsdo.it
You're free to use your own sound source for JAM, if you have rights to use it.
We recommend soundcloud.com to upload music.
http://assets.wonderfl.net/sounds/event/jam/drop1.mp3
http://assets.wonderfl.net/sounds/event/jam/drop2.mp3
http://assets.wonderfl.net/sounds/event/jam/drop3.mp3
http://assets.wonderfl.net/sounds/event/jam/drop4.mp3
http://assets.wonderfl.net/sounds/event/jam/drop5.mp3
http://assets.wonderfl.net/sounds/event/jam/drop6.mp3
http://assets.wonderfl.net/sounds/event/jam/drop7.mp3
http://assets.wonderfl.net/sounds/event/jam/drop9.mp3
http://assets.wonderfl.net/sounds/event/jam/drop9.mp3
http://assets.wonderfl.net/sounds/event/jam/drop10.mp3
♥0 | Line 39 | Modified 2010-10-15 13:25:09 | MIT License | (replaced)
play

ActionScript3 source code

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

// forked from Event's Instrument
package {
    import flash.media.Sound;
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.events.*;
    /*
     *  ※お題のプログラムで使用している音源の、当イベント以外での使用を禁じます。
     * それ以外の音源の使用は自由ですので、他に使用した音源がありましたら、権利をご確認の上各自ご用意下さい。
     * なお、当イベントでは、音源のアップロード場所として、こえ部( http://koebu.com/ )のご利用を推奨いたします。
     * * mp3 files used in the code are not allowed to use outside wonderfl.net/jsdo.it
     * You're free to use your own sound source for JAM, if you have rights to use it.
     * We recommend soundcloud.com to upload music.
     * http://assets.wonderfl.net/sounds/event/jam/drop1.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop2.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop3.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop4.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop5.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop6.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop7.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop9.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop9.mp3
     * http://assets.wonderfl.net/sounds/event/jam/drop10.mp3
     */
    public class FlashTest extends Sprite {
        public var sounds:Array;
        public function FlashTest():void {
            init();
            stage.addEventListener(MouseEvent.MOUSE_DOWN, mDown);
            stage.addEventListener(Event.ENTER_FRAME, loop);
            
            
        }
        public function FlashTest1():void {
            new Sound(
                new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop1.mp3"))
                    .play();
        }
        public function init():void{
            sounds=new Array();
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop1.mp3")));          
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop2.mp3")));
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop3.mp3")));
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop4.mp3")));
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop5.mp3")));
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop6.mp3")));
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop7.mp3")));
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop8.mp3")));
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop9.mp3")));
            sounds.push(new Sound(new URLRequest("http://assets.wonderfl.net/sounds/event/jam/drop10.mp3")));
            trace(sounds.length);
        
        }
        public function mDown(e:MouseEvent):void{
            var num:uint=Math.floor(Math.random()*sounds.length);
            sounds[num].play();
        
        }
        public function loop(e:Event):void{
                
        
        }

   

        
    }
}