ok basically im all done now the music problem kicks in gear
i have 7 songs
this is the first thing i have on my timeline
mySound1 = new Sound();
mySound2 = new Sound();
mySound3 = new Sound();
mySound4 = new Sound();
mySound5 = new Sound();
mySound6 = new Sound();
mySound7 = new Sound();
this is for what i have for the buttons
on(press) {
if (playing!=true) {
if (playing=true);
soundIsLoaded=1
mySoundObject1=new Sound();
mySoundObject1.setVolume(55);
mySoundObject1.loadSound("1.mp3",true) //streaming
}
_root.mySoundObject1.onSoundComplete=function()
{playing=false;}
}
now i have the stop button , this is my problem its not stopping the songs!! what is wrong???
please someone help me or show me another way to do it where i just click on the numbers and the music stop playing!
i have the music buttons all in a movieclip
I dont know if mySound1.stop(); will even work, but I guess it does. The problem is that the two buttons aren’t using the same variable. Instead, they define their own variable. You have to put [COLOR=BLUE]playing[/COLOR] in _root, so they both use the same variable.
Just replace every [COLOR=BLUE]playing[/COLOR] by [COLOR=BLUE]_root.playing[/COLOR].
There’s something I don’t get about your code. This doesn’t make sense, does it ? It’s like saying: “If playing is true.” without a “then do” part.
Let’s load the sound externally to keep your file size down.
Frame 1:
[AS]
sound1 = new Sound();
sound1.loadSound(“sound1.mp3”,true);
sound1.start(0,999);
[/AS]
Breaking down the code:
sound1 is declared as our first sound object.
loadSound simply loads the external sound(make sure its in same directory as .swf)
true declares that we are streaming the sound so the user does nto have to wait for it to download.
last line means load the sound on level 1 and loop it 999 times.
to stop your sound simply add this to the button in which you would like the sound to stop
[AS]
on(release){
sound1.stop;
}
[/AS]
to add more sound just follow the steps. to disbale sounds you can change your code to something like this:
digital i have to add the _root. code infront of your stop code the code from before also needs _root !! hehe wow what a brain buster.
Ok now here is my question lets say if i wanted to eliminate the STOP button and make it when you click on the button it stops all the other sounds and then it plays its sound
or it checks if the other songs are playing and if they are itll stop it and then play the song from the button clicked
That will tell button 1 to stop sound y and play sound x, and vice versa. Get that to work then we will tell the buttons if the soudn id already playing, do not start it again.
btw i leave work in 10 minutes, ill be home by 4:00, if you need more help ill be happy to do so, also if you really get stuck post your .fla and ill take a look when i get home.