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!

load external music into a .swf and play through AS

Status
Not open for further replies.

martinb7

Programmer
Jan 5, 2003
235
GB
Hi,
Ive got a .swf with a preloader and while its loading I want it to load a .mp3 into the .swf so it isn't too big
But I dont want it to play straight away, i want to make it play when it reaches frame 5 for example because I want to make an intro.

code i have got at the moment

//frame 1-4 is the preloader

Code:
mysound = new Sound();
mySound.loadSound("[URL unfurl="true"]http://mysite.com/folder/my[/URL] song.mp3", true);

//frame 5 = intro
Code:
mySound.play();

Can anyone help me?

Thanx

Martin
 
i dont see a problem...what you have above is correct...you are not loading the mp3...you are streaming it in

what is it thats wrong ?
 
I wanted the preloader to load the song so its fully loaded for the intro, but not to play til it gets to frame 5.

Is this possible?
 
in that case have the mp3 in the library marked export for actionscript and use attachsound in frame 5
 
If you weren't using streaming but an event sound, you could preload it and only start it up on frame 5.

See How to build a preloader for dynamically loaded MP3's here:
Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top