Ik ben bezig met een mp3 speler in flash maar ik krijg telkens opnieuw een fout, ik weet niet of dit is iets is in mijn actions of omdat ik mijn actionscript in SEPY heb gemaakt. Ik vroeg me af of iemand dit zou willen nakijken?
Code:
// 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.first.Child.childNodes;
for(var i=0;i<nodes.length;i++)
{
sa.push(nodes[i].attributes.url);
}
playSong();
}
xml.load("songs.xml");
// Play the MP3 file
function playSong():Void
{
if(cps == sa.length - 1)
{
cps = 0;
s.loadSound(sa[cps], true);
}
else
{
s.loadSound(sa[++cps], true);
}
}
Het zou ook zo kunnen zijn dat de fouten zitten in de { haakjes.
Alvast bedankt!