Question:

In Flash MX how do I tell my volume slider that the music is already playing when the page starts?

by  |  earlier

0 LIKES UnLike

Here is a chunk of my actionscript 1.0 from my volume slider...

}

play_btn.onRelease = function(){

mySong = new Sound();

mySong.attachSound("shakethis");

mySong.start (0, 50);

}

What line could I add to tell it that if the music is already playing to function properly. Right now the volume slider won't adjust volume unless the user hits stop then play again on my buttons. Thanks!

 Tags:

   Report

1 ANSWERS


  1. To make the setVolume work, the code needed to be in onClipEvent(enterFrame) becaue when the flash is running, the code in onClipEvent(enterFrame) is cycle at a rate of at least 4 times/sec.. Then when you move the slider, the event will trigger the function to get the x & y coordinates of the slider's handle and pass the data to setVolume( ). Other than onClipEvent(enterFrame), you can only set volume by code, not interactive.

    The next thing you have check is the conversion of x, y coordinates of the slider's handle, would it pass the expected range of number to the setVolume, if it is not, actionscript will just ignore it and no effect.

    Hope this helps.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.