Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loadSound. problems 1

Status
Not open for further replies.

georgyboy

IS-IT--Management
Oct 20, 2002
197
AU
Hi,
asking for help (again!)
am having trouble with the loadSound action.
I can make the sound load alright _ but it wont loop, i have been over kenny bellews site 100 times and tried eveything but nothing works. I am trying to make the sound load as the movie loads.
heres the code i am using

myMusic = new sound();
myMusic.loadSound("Another Gangster Loop1.mp3",true);
myMusic.start();

and i have tried to put in the (0,999) at the end of the start as well but its not working.

Any ideas
Thanks
 
You probably only have to add an onSoundComplete() function, that would simply re-start the sound when it's finished playing...

Regards,

cubalibre2.gif
 
hey oldnewbie, thanks again. heres my whole problem (just went thru the site)
have got a main movie which several submovies load into it. i have dynamically loaded a 'loop' onto all seperate pages thru the loadsound action.
my problem(s) are that the 'loops' arent looping (am about to try ur advice) and that if i go to another page the loop from the page i was just on keep playing until finished.
How do I
_ get the loops to loop properly
_ get it so the loops only play when the pages are on screen and stop when i go to another page.

sorry - its alot to ask, but i am having a real bi$ch of a time with the music side of flash (am reading kennybellews though)

Thanks in advance
 
First thing is you should allways add this to your soundObjects definitions...

myMusic = new sound(this);
myMusic.loadSound("Another Gangster Loop1.mp3",true);
myMusic.start();

This may or not change anything in solving your current problem but may affect your sounds in other situations.

Also try to avoid spaces in files names... That may also cause some more problems. Use underscores if you must.

That said onSoundComplete() should solve part of your problems, and maybe the use of stopAllSounds(), when changing page, would stop the previous playing sound, if you can't get a "my_sound = stop();" action to work and that assuming the starting the new sound was started after the stopAllSounds() was used.

Maybe e_mail me your .fla, if you can't get it going still!





Regards,

cubalibre2.gif
 
thanks mate _ that was a great help, really appreciate it.
might be back soon though, am having trouble with my buttons now ;) making the sound turn on an off
Regards
 
am i able to put my buttons on the main movie so that they work with the submovies?? or do i have to keep them in their respective movies with their sounds??
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top