6/6/2010 11:35:55 PM
Title:
how Control Volume in flex mp3 player?
hi...
can any one explain how to control volume of flex mp3player:
im using this example.
i can play sound or mp3 songs but i cant control the volume.
plz reply
6/7/2010 1:05:11 AM
you can use the following code to control main sound volume of flash movie. Use a slider from 0-10 and set the volume
MainSoundControl = new Sound();
//the value can be set from 0-100.100 is full volume
MainSoundControl.setVolume(50);
6/7/2010 1:49:22 AM
this is not working and
i cant find MainSoundControl ?
plz explain me how its work or tell me any other solution
reply me
6/7/2010 2:05:49 AM
define the sound first
var MainSoundControl:Sound = new Sound();
6/7/2010 2:47:17 AM
hii...sorry but MainSoundControl.setVolume(50); is undefine method ..so what i do.
plz help
6/7/2010 4:02:58 AM
I think the code by Rex was actionscript 2.0 code. Check this actionscript 3.0 code to control and play sound in flex.
var mySnd:Sound = new Sound(new URLRequest("mysound.mp3"));
var soundTrans:SoundTransform = new SoundTransform(0.6);
var soundChannel:SoundChannel = mySnd.play(0, 1, soundTrans);
//to change sound later use . Value should be between 0.0(Min) to 1.0 (Max)
soundChannel.soundTransform(0.5);