Hi,
I'm loading the xml path into my flash by using FlashVars.
The first time you click a link it doesn't play the song, but the second link you hit works and if you go back to the first link you clicked it works now.
Here's an example
I get these 2 errors in my flash
I load my xml path into the flash movie so the second _level0.textis correct.
Error opening URL 'file:////Venus5/multimedia/Interactive/MMED%5F0025%20Elvis%20Collectable%20Tins/Xtras/Javascript%5FTalking%5Fto%5Fflash/undefined'
Error opening URL 'file:////Venus5/multimedia/Interactive/MMED%5F0025%20Elvis%20Collectable%20Tins/Xtras/Javascript%5FTalking%5Fto%5Fflash/_level0.text'
Can anyone see why this is happening?
Code:
stop();
// Setup sound object
var s:Sound = new Sound();
s.onSoundComplete = playSong;
s.setVolume(75);
// Array of songs
var sa:Array = new Array();
// Currently playing song
var cps:Number = -1;
// Load the songs XML
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
for(var i=0;i<nodes.length;i++)
{
sa.push(new Song(nodes[i].attributes.url, nodes[i].attributes.artist, nodes[i].attributes.track));
}
playSong();
}
xml.load(text);
function playSong():Void
{
s = new Sound();
s.onSoundComplete = playSong;
s.setVolume(75);
mute.gotoAndStop("on");
if(cps == sa.length - 1)
{
cps = -1;
s.loadSound(sa[cps].earl, true);
}
else
{
s.loadSound(sa[++cps].earl, true);
}
trackInfo.text = sa[cps].track;
playPause.gotoAndStop("pause");
textPos = 0;
}
Thanks,