ive been through an mp3 tutorial…
THE PROBLEMS IS that it comes up wiv an error.
Error opening URL “file:///C|/Documents%20and%20Settings/mp3/undefined”
what does it mean???
and what shall i do???
i recieved this code…
// Setup sound object
var s:Sound = new Sound(); //s is the sound object
s.onSoundComplete = playSong; // on sound complete event... when mp3 finisha nd carry on with the next
s.setVolume(75); //inital volume = 75%
//create array to hold songs to read from xml
var sa:Array = new Array();
// create var to hold current playing song
var cps:Number = -1; //
//position of music
var pos:Number;
// Load the songs xml
var xml:XML = new XML(); //create xml object
xml.ignoreWhite= true; // ignore white spaces in xml
xml.onLoad = function()//repond to
{
var nodes:Array=this.firstChild.childNodes; // refering to song tags
//iterate
for(vari=0;i<nodes.length;i++)
{
sa.push(nodes*.attributes.url);
}
playSong();
}
xml.load("songs.xml"); //load xml file
// play mp3 file function
function playSong():Void
{
s = new Sound();
if(cps == sa.length - 1) // if cps is the last song
{
cps=0;
s.loadSound(sa[cps],true); //start playing new mp3 sound
}
else
{
s.loadSound(sa[++cps],true);
}
playPause.gotoAndStop("pause");
}
//music controls
//pauses the music
function pauseit():Void
{
pos =s.position;
s.stop();
}
function unPauseit():Void
{
s.start(pos/1000);
}
//play/pause tohhle
playPause.onRollOver = function()
{
if(this.currentframe ==1)
{
this.gotoAndStop("pauseOver");
}
else
{
this.gotoAndStop("playOver");
}
}
playPause.onRollOut = playPause.onReleaseOutside = function()
{
if(this.currentframe ==10)
{
this.gotoAndStop("pause");
}
else
{
this.gotoAndStop("play");
}
}
playPause.onRelease = function()
{
if(this._currentframe == 10)
{
this.gotoAndStop("playOver");
this._parent.pauseit();
}
else
{
this.gotoAndStop("pauseOver");
this._parent.unPauseit();
}
}
//next button
next.onRollOver = function()
{
this.gotoAndStop("nextOver");
}
next.onRollOut = next.onReleaseOutside = function()
{
this.gotoAndStop("next");
}
next.onRelease=function()
{
this._parent.playSong();
}