-
Bmcc*81
[RESOLVED] [f8] MusicPLayer 2 errors
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,
Last edited by bmcc81; 04-30-2008 at 01:15 PM.
-
Total Universe Mod
1. you should not have onSoundComplete in two places. Try and take that command out of playSong()
Also, this line is likely the error
PHP Code:
cps = -1; s.loadSound(sa[cps].earl, true);
There is nothing assigned to an array at -1 so you are attempting to load
sa[undefined].earl. Try defaulting cps to 0 if you want to start at the beginning of the playlist and sa[sa.length-1] to start at the end.
-
Bmcc*81
Hmm. thanks but it didn't seem to work. I still get the 2 error messages.
Any other idea's?
and there other example I gave was a bad link So here
Thanks for the help
Last edited by bmcc81; 04-30-2008 at 02:31 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|