PDA

View Full Version : MediaPlayback component question.


keliix06
10-30-2003, 12:25 PM
I know how to load the variables from a MySQL database through php now (thanks to the tutorials), but I was wondering what I need to enter in place of the url. Can someone help me out a little?

setMedia("WHAT GOES HERE", "mp3");

Thank you.

keliix06
11-04-2003, 01:35 PM
Maybe a little background on what I'm trying to accomplish would help.
I have a media player (non-flash) setup that pulls a song at random from a database, and plays it using the <EMBED> tag. I want to get rid of that and use flash instead. I can get the player to work when I put in the URL of the mp3, but I need it to be randomly generated from the database (mysql) using php.
Anyone else try to do this and have any luck?

mrand01
11-04-2003, 03:09 PM
mySong_lv = new LoadVars(); //create new LoadVars object
mySong_lv.onLoad = function(success) { //run this function when the variables are loaded
_global.SongToLoad = mySong_lv.loadedSong; //when you return your value from PHP, it gets loaded into your LoadVars object; I used "loadedSong" as a variable, you can use anything
myMedia.setMedia("http://yourdomain/yoursongs/" + SongToLoad, "MP3"); //sets the media for the player (ex: loadedSong = "song.mp3")
}
mySong_lv.sendAndLoad("http://yourdomain/yourscript.php", mySong_lv, "POST"); //load variables out of PHP script


thats the best I can explain it :)