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!

Trouble adding .mp3 to project

Status
Not open for further replies.

utahjzz98

Programmer
Jan 9, 2003
69
US
Hello, I have just started to play around with Flash this week and I am having trouble importing an .mp3 file to my project. It gives me the error, "One or more files were not imported because there were problems reading them". However, this is only for certain .mp3 files. I can import some .mp3's, just not all of them. They all exist in the same folder and I made sure that the file name were legit. I am completey lost, so if anybody could help, I would appreciate it!

Regards,
Corey
 
if you are using mx do the following

leave the mp3 files external to the flash movie but load them up to your server

add this code to the first frame of your flash movie

mySound = new Sound();
mySound.loadSound(" true);
mySound.start();
//just change the above to the url of the mp3 file you wish to play
 
Would this be the same for version 5.0? That is the version I am currently using.
 
no...the above will only work with mx

You can import the mp3 into Flash export as a seperate swf file and use loadMovie to load it in, but no direct runtime import of mp3 is possible in Flash 5.

This is probably the best way for you to go as mp3 tend to be large files

Open a new file, import your mp3, go to the library
and give this mp3 an identifier name - sound1, in
the Symbol Linkage Properties. Put this on frame 1 :

mySound = new Sound();
mySound.attachSound("sound1");
mySound.start();

save and publish. then to play the sound in your main swf use loadmovie to get the mp3 in.

 
mySound = new Sound(this); !!!
Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top