View Full Version : looping background sound
swillicott
11-17-2005, 10:48 PM
Hi all,
I wonder if anyone can help me. i am new to flash and actionscript and i am working on an online portfolio site. I am trying to add a background music loop but have read (for about 2 hours) of all sorts of ways to do this - but I cannot get any of them to work - could anyone tell me the best way to do this?
Thanks
Steve
Stinkin Mushroom
11-17-2005, 11:56 PM
Make a seperate layer for your music, then just drag your music from your library.
go to the frame where is your your music and look on the properties below ==> you can choose several things: loop, repeat,etc. repeat is to choose how many times you repeat it, and loop is just constantly repeating.
on sync put it on Event
Just try different syncs and you'll find what you need
PS: you don't need action scripting for this ;)
arkanoid2k
11-18-2005, 12:13 AM
if you use the timeline to control the sound, it can only be looped for 99 times. keep tha in mind... at some point you will need some kind of AS to worl it out.
try some research on--> Sound.loadSound()
m00gzilla
11-18-2005, 05:13 AM
couldnt you create it on a seperate movieclip that also has a sound on/off option which also has script to loop infinitly?
arkanoid2k
11-18-2005, 01:06 PM
yes its possible to place it in its own MC. at the end of the sound_mc timeline, just place a gotoAndPlay(what ever frame).
ravuri
11-18-2005, 03:48 PM
here is the example
function playsound(){
mysound = new sound();
mysound.loadSound(url);
mysound.onSoundComplete =playsound;
mysound.start();
}
Hi all,
I wonder if anyone can help me. i am new to flash and actionscript and i am working on an online portfolio site. I am trying to add a background music loop but have read (for about 2 hours) of all sorts of ways to do this - but I cannot get any of them to work - could anyone tell me the best way to do this?
Thanks
Steve
swillicott
11-20-2005, 02:54 PM
thanks for al your help. Ravuri, in the actionscript example you give, where does the 'mysound' come from? do you have to namean instance or name the sound?
Steve
kornholio73
12-08-2005, 10:15 AM
following is the situation...
i have am creating a christmas e-card for my client with Flash, all is fine except i can't get the music to play properly...
here is what i did, i drag the music file directly into line 1 of scene 1 (i have total of 6 scenes), the last scene being the greeting page with a replay button, i then published the movie and test run it on-line...the music and video play perfectly except when i hit the repay button, the video goes back to scene1 frame1 along with the background music, the problem is the music from the first playback is now still playing in the background therefore i have overlapping background music...i hope it makes sense...
what i am looking for is simply music and video playing indepently of each other...i know there is a way of doing this but i don't know how...
any help is greatly appcriated
oh and one more thing, i have only been using Flash for 3 days....i know i know, i shouldn't have accepted the job but i needed the cash for christmas..
please explain as thoroughly as u could since i am a total newbie...again sorry for this inconvenience....
deseprately,
richard
swillicott
12-11-2005, 09:01 PM
Hi Richard,
Don't worry, i think we can solve this. You need to add a stop all sounds script to your play again button. This way, when you click the play again button, the original sound that started the first time it played will stop. Then the new sound that will play when you re start the movie will play - not two together.
Put the following script on your play again button:
on (press) {
stopAllSounds();
gotoAndPlay(YOUR FIRST SCENE NAME,1);
}
I am not sure about the scene name part of the script as I never use scenes, you should be able to put the name of your scene in the space shown. Then, when the button is pressed, all sounds will stop playing and the playhead will go to the first scene and frame 1.
Let me know if this works - If not we will try something else.
Steve
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.