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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stream an external mp3???

Status
Not open for further replies.

aamaker

Programmer
Jan 20, 2002
222
US
Im looking for an .fla example or actionscript example of how I can stream an external mp3 file when a site loads.

Anyone have an example?

-- Thanks
 
mysound = new sound();
mysound.loadSound("my.mp3",true);
mysound.start();


placed in frame 1 this will stream in the mp3
 
Awesome... Thanks.

If I wanted to pre-load a portion of it prior to starting the 'play'ing of it... how would/could I do that?

Can I load a % of it or does it have to be in number of bytes?

-- Thanks again.
 
preloading it in defeats the purpose of streaming the file so i dont understand what you are trying to do.
 
What you allways wanted to know about sound, but were afraid to ask!


Regards,

cubalibre2.gif
 
well streaming with mp3 with flash is very cool. i know you can use a macromedia communication server and handle it.

but its too expensive i think. i have another method read here in the forum, and then i expand this a little bit. it works fine.

you can try it out:

put this action in the first frame:

mysound = new sound();
mysound.loadSound("1.mp3",true);
mysound.start();

then make a button and put this code to the button:

on (release) {
stopAllSounds();
mysound2 = new sound();
mysound2.loadSound("2.mp3",true);
mysound2.start();
}

an now its your turn:
try to change the following lines:
// first frame
mysound.loadSound("1.mp3",true);

to

mysound.loadSound("YOUR_URL_TO_YOUR.mp3",true);


//and the button
mysound2.loadSound("YOUR_URL_TO_YOUR.mp3.mp3",true);

anyone who try this out, please reply to my post here. i have a lot of work around. your comments will help me a little bit to have more time in programming flash.

thnx

GtPA - gOd tHnX PROGrAMmERS ArmY
 
mySound = new Sound();
mySound.loadSound("1.mp3", true);
stop();


... where I have 1.mp3 in the same folder as the flash file... the 'true' statement means it is set to stream, if false, entire audio file will load then play.

Let me know how you make out with this.

- Tony
 
hi,

tony i didnt understand your comment. plz explain me a liitle bit more.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top