Skip to main content
Participant
December 14, 2006
Question

Database MP3 Player like MySpace

  • December 14, 2006
  • 1 reply
  • 219 views
I am trying to make a mp3 player similar to the ones on myspace. I need the player to start playing the song contained in my MYSQL Database under the users name. How would I do this. right now I have a play and stop button, but that is it. I am new to Flash, and couldn't find a tutorial on how to do this anywhere... I found some on connecting to mysql with PHP, but I didn't know how to make that work, or much less use it to play mp3's. Also, I am fairly fluent with PHP if that helps.
This topic has been closed for replies.

1 reply

Inspiring
December 15, 2006
Hi,

You might try looking at passing the mp3 name via the object tags within the page that the .swf sits

Then take a look at:

http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002679.html

where the line of code:
"my_sound.loadSound("song1.mp3", true);"
is all you have to do is maybe change it to:
my_sound.loadSound(myAudioFile+".mp3", true);
with "myAudioFile" being the variable being declared within the object tags in the actual page where the swf sits

So your Object tags within the page might look something like this:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="400" height="300" id="hitTest" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="myMP3Player.swf?myAudioFile='bobTheBuilder'" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="myMP3Player.swf?myAudioFile='bobTheBuilder" quality="high" bgcolor="#ffffff" width="400" height="300" name="hitTest" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />

bobTheBuilder being bobTheBuilder.mp3 audio file.

Cheers