Create a Seek Bar for a Mp3 Sound File : Mp3 « Development « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Development » Mp3Screenshots 
Create a Seek Bar for a Mp3 Sound File
Create a Seek Bar for a Mp3 Sound File
         

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:VBox width="400" height="300" creationComplete="loadSound()">
        <mx:Script>
            
    
                private var sound:Sound;
                private var chan:SoundChannel;
    
                private function loadSound():void {
                    sound = new Sound(new URLRequest("http://localhost/Plans.mp3"));
                    chan = sound.play();
                }
    
                private function scanPosition():void {
                    chan.stop();
                    chan = sound.play(positionSlider.value/10 * sound.length);
                }
    
                private function scanVolume():void{
                    var trans:SoundTransform = new SoundTransform(volumeSlider.value, (panSlider.value - 5)/10);
                    chan.soundTransform = trans;
                }
    
          
        </mx:Script>
        <mx:Label text="Position"/>
        <mx:HSlider change="scanPosition()" id="positionSlider"/>
        <mx:Label text="Volume"/>
        <mx:HSlider change="scanVolume()" id="volumeSlider"/>
        <mx:Label text="Pan"/>
        <mx:HSlider change="scanVolume()" id="panSlider"/>
    </mx:VBox>
</mx:Application>
    

   
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Play and Pause an MP3 FilePlay and Pause an MP3 File
ww___w___.__j___a__v__a2_s_.c___o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.