Hello,
Thank you very much for the help.
For some reason it's still not working. The files do not seem to be being loaded. I tried to switch to an absolute path but it didn't seem to help. You'll have to forgive me, I'm really green to actionscript. This is the code for my Flash Player. It was working fine for just appending
lv = new LoadVars();
//
lv.onLoad = getFiles;
//
function getFiles(success)
{
if (success)
{
mp3list = new Array();
//
var i = 0;
//
while (this["file" + i] != undefined)
{
mp3list = this["file" + i];
i++;
}
//
trace(mp3list);
}
}
//
lv.sendAndLoad('mp3pop.php', lv, 'POST');
volumeB.stop();
volumeB.onPress = function()
{
this.gotoAndStop(3);
this.startDrag(false, this.x, 29, this.x, 144);
volumeB.onMouseMove = function()
{
mp3Sound.setVolume(100 - ((this._y - 29) / 115) * 100);
}
}
volumeB.onRelease = volumeB.onReleaseOutside = function()
{
this.gotoAndStop(1);
this.stopDrag();
}
function loadTrack(fname)
{
mp3Sound = new Sound();
mp3Sound.loadSound(fname, true);
mp3Sound.onID3 = function()
{
textString = this.id3.track + ". " + this.id3.songname + " (c)" + this.id3.year + " - " + this.id3.artist + " - " + this.id3.album + " ";
tracktitle.text = textString;
}
mp3Sound.onSoundComplete = nextTrack;
tracktitle.text = fname;
tracktime.text = "0:00";
}
currentTrack = -1;
function nextTrack()
{
clearInterval(playback);
playback = setInterval(refreshDisplay, 250);
wrap = 0;
currentTrack++;
currentTrack%=mp3list.length;
loadTrack(mp3list[currentTrack]);
}
function prevTrack()
{
clearInterval(playback);
playback = setInterval(refreshDisplay, 250);
wrap = 0;
currentTrack--;
if (currentTrack < 0) currentTrack = mp3list.length-1;
loadTrack(mp3list[currentTrack]);
}
function stopTrack()
{
stoppos = mp3Sound.position;
mp3Sound.stop();
}
function resumeTrack()
{
if (stoppos == undefined)
{
nextTrack();
}
else
mp3Sound.start(stoppos / 1000);
}
function rewindTrack()
{
pos = mp3Sound.position;
pos -= 2500;
if (pos < 0) pos = 0;
mp3Sound.start(pos / 1000);
}
function ffwTrack()
{
pos = mp3Sound.position;
pos += 2500;
mp3Sound.start(pos / 1000);
}
nextTrack();
nextTrackButton.onRelease = nextTrack;
prevTrackButton.onRelease = prevTrack;
stopButton.onRelease = stopTrack;
playButton.onRelease = resumeTrack;
rewindButton.onRelease = rewindTrack;
ffwButton.onRelease = ffwTrack;
progressb.inner._width = 0;
refreshDisplay = function()
{
tracktitle.text = textString.substr(wrap, textString.length) + textString;
wrap++;
wrap %= textString.length;
var pos = Math.floor(mp3Sound.position / 1000);
sec = (pos % 60).toString();
min = Math.floor(pos / 60).toString();
if (sec.length == 1) sec = "0" + sec;
tracktime.text = min + ":" + sec;
progressb.inner._width = (mp3Sound.position / mp3Sound.duration) * 250;
}
The php file that holds the mp3 player is called mp3pop.php. I have this code within that file:
$dir="mp3/";
$res = mysql_query("select mp3 from songs where bandid = '$bandid' order by rand()");
$n = 0;
while($row = mysql_fetch_array($res))
{ print "&file$n=" . $dir . $row[0];
$n++;
}
The printout on this page is
&file0=http://www.mysite.com/mp3/6545.99.mp3&file1=http://www.mysite.com/mp3/4348.99.mp3....
Everything was ok with the player when I was just using one song at a time and using a GET statement on the swf URL. One question that I have is; is it necessary to echo the results on the php page in order to get the variables sent to Flash? I'd rather do without if possible.
I really appreciate ANY help on this one. Thank you very much.