header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
gourav
Points:540
Posts:0
Answered

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



1
Rex
Points: 1180
Posts:0
Accepted Answer
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);  


2
gourav
Points: 540
Posts:0
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


3
MaxFlash
Points: 580
Posts:0
6/7/2010 2:05:49 AM



define the sound first
var MainSoundControl:Sound = new Sound();

4
gourav
Points: 540
Posts:0
6/7/2010 2:47:17 AM



hii...sorry but MainSoundControl.setVolume(50); is undefine method ..so what i do.
plz help

5
MaxFlash
Points: 580
Posts:0
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);



Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+8 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions