Forum Moderators: open

Message Too Old, No Replies

I want to build a flash sound-player that reads the

name of the sound-file from html (with flash-4)

         

sven1977

4:50 pm on Sep 26, 2005 (gmt 0)

10+ Year Member



Hi there,
I'm pretty new to flash and do not use it very often, but I would like to add sound-files to my webpage and think that the only reasonable way of doing it is through flash.
I only have flash-4, so I was wondering, whether one can create a simple sound-player (just one button play/stop), which gets the information about which file to play from html (<object/embed/parameter>). I know already, how the parameter passing from html works. All I want to know is how to create a sound object in flash-4 and how to pass to it the filename of the mp3/wav file so that the player will play this file.
Do you have any ideas?
Thanks for your help,
Sven

Richard_N

10:19 pm on Sep 26, 2005 (gmt 0)



get a more upto date version of flash, it really needs to be done with actionscript 2, flash 4 barely supports actionscript 1.

The code is relatively simple, but I am pretty sure it will not work on a flash version that old

figment88

10:35 pm on Sep 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you could also get an already programmed flash player that loads files thourgh xml or reading all files in a directory, etc.

sven1977

2:48 am on Sep 27, 2005 (gmt 0)

10+ Year Member



Ok, I downloaded flash MX (trial version) and I think I'm just too stupid:
This is what I did:

myMp3 = new Sound();
myMp3.loadSound("a.mp3", false);
myMp3.start(0, 1);

This whole thing goes into the actionscript for Frame 1. When I test the movie it doesn't give me an error message but it also doesn't play the sound. When I exchange a.mp3 through b.mp3 and b.mp3 does not exist, it does give me an error message. I just can't get the damn sound playing.
Can you help me?
It really seems like an easy thing.
Thank you,
Sven

think_tank

7:25 am on Sep 28, 2005 (gmt 0)



sourceforge have some great simple players available for use here [musicplayer.sourceforge.net]... personally I find this [web.uvic.ca] an elegant solution.

sven1977

12:06 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



Thanx to all of you, I found out what it was. It just didn't work because of the mp3-file that I used for testing. Never came to my mind to try another file. It's weird, but all other files worked fine with my actionscript.
Also the file that didn't work works fine when I run the ready swf on the server. Funny thing, but it cost me a whole day.
Thanks anyway,
Sven