Welcome Guest [Log In] [Register]
Welcome to Brackenwood. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
repeating mp3's; when streaming
Topic Started: Dec 30 2005, 09:08 PM (197 Views)
Krob
Brackenwood Lightweight
this might, again, be a very stupid question, but i looked a bit everywhere and couldnt find it

when i use "LoadSound("bla.mp3",true)" to load an external mp3 file
and then "song.Start(0,999)" it doesnt repeat

if i use attachSound("bla") (when its put in the library it works just fine..)

what also works is setting an interval and hardcoding the time..
because song.duration gives 0 when you use loadsound :-/
and thats not really the correct way to repeat is it :P

how would i best do it then? (it has to be external, school policy ;p) (due to filesize-limits of the swf..)
Offline Profile Quote Post Goto Top
 
Mr. Jiggmin
Member Avatar
made of tulips
Here's a way to get streaming sound to loop. It begins playing immediately, but you have to download it again every time it repeats. (I think... or maybe it caches it?)
Quote:
 
//sets up the sound
_root.createEmptyMovieClip("songHolder", _root.getNextHighestDepth());
song = new Sound(songHolder);
//when the song finishes it starts again
song.onSoundComplete = function() {
song.loadSound("song1.mp3", true);
};
//starts the song for the first time
song.onSoundComplete();


Or if it's just a short background loop, it's probably better to play it as an event sound. You have to wait for the whole thing to download before it can play, but you only have to download it once.
Quote:
 
//sets up the sound holder
_root.createEmptyMovieClip("songHolder", _root.getNextHighestDepth());
song = new Sound(songHolder);
//loads the sound with streaming set to false
song.loadSound("song1.mp3", false);
//when it's finished loading you play it
song.onLoad = function() {
song.start(0, 3);
};
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Actionscript · Next Topic »
Add Reply