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

SionTest

noteOn
Get Adobe Flash player
by aobyrne 19 Jul 2011
    Embed
/**
 * Copyright aobyrne ( http://wonderfl.net/user/aobyrne )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/1WzW
 */

package 
{
    import com.bit101.components.HUISlider;
    import com.bit101.components.PushButton;
    import flash.display.Sprite;
    import flash.events.Event;
    import org.si.sion.SiONDriver;
    
    /**
     * ...
     * @author sandcastles
     */
    public class SionTest extends Sprite
    {
        private var v:Number=66;
        private var siONDriver:SiONDriver;
        public function SionTest() 
        {
            siONDriver = new SiONDriver();
            var hUISlider:HUISlider = new HUISlider(this, 0, 0, "note", doChangeNote);
            hUISlider.tick = 1;
            hUISlider.value = v;
            new PushButton(this, 0, 20,'stop',doStop);
            new PushButton(this, 0, 50,'play',doPlay);
        }
        
        private function doPlay(e:Event):void 
        {
            siONDriver.play();
            siONDriver.noteOn(v);
        }
        
        private function doStop(e:Event):void 
        {
            siONDriver.stop();
        }
        
        private function doChangeNote(e:Event):void 
        {
            v = HUISlider(e.target).value;
            siONDriver.stop();
            doPlay(e);
        }
    }
    
}