Hi guys,
this is probably very easy this but after several attempts to try and make this player NOT automatically play on loading and also not loop after playing each track I am now completely stumped!!
There are two scripts attached to the player below and any help would be very much appreciated.
ACTION SCRIPT 1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
this._lockroot = true;
// play button function
function startoff() {
ply = true;
stpd = false;
dd.stop();
stopAllSounds();
dd.start();
pus = false;
if (!noprenext) {
information.info = “Direct Experience”;
information.play();
information.info = “Playing”;
}
}
function playit() {
ply = true;
noprenext = false;
stpd = false;
information.info = “”;
information.play();
information.info = “Playing”;
if (listloaded) {
if (pus && pindex == i) {
dd.start(position);
pus = false;
} else {
dd.stop();
stopAllSounds();
dd.start();
item = pindex;
i = item;
dd.loadSound(mm[item], true);
pus = false;
}
} else {
if (pus) {
dd.start(position);
information.info = “Playing”;
pus = false;
} else {
dd.stop();
stopAllSounds();
dd.start();
}
}
}
//pause button function
function pauseit() {
if (!stpd) {
position = dd.position/1000;
if (!pus) {
dd.stop();
pus = true;
information.info = “”;
information.play();
information.info = “Paused”;
} else {
dd.start(position);
pus = false;
information.info = “Playing”;
}
}
}
//stop button function
function stopit() {
if (!stpd) {
dd.stop();
stpd = true;
noprenext = true;
pus = false;
information.info = “”;
information.info = “Stopped”;
information.play();
}
}
function noplay() {
if (!stpd) {
dd.stop();
stpd = true;
//noprenext = true;
pus = true;
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ACTION SCRIPT 2
dd = new Sound();
mm = new Array();
// XMl code for loading URLs.
function loadXML(loaded) {
if (loaded) {
for (i2=0; i2<this.firstChild.childNodes.length; i2++) {
mm[i2] = this.firstChild.childNodes[i2].firstChild.nodeValue;
dd.loadSound(mm[0], true);
}
} else {
trace(“file not loaded!”);
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“http://www.eoinscolard.com/shop/skin/frontend/default/modern/audio/list.xml”);
var i:Number = 0;
function playprev() {
// if (i>0) {
//i -= 1;
// this will make it play in repeat mode ,
if (i == 0) {
i = mm.length-1;
} else {
i -= 1;
}
dd.loadSound(mm*, true);
if (noprenext) {
noplay();
}
list_mmc.list_p.list.selectedIndex = i;
}
function playnext() {
i += 1;
// this will make it play in repeat mode ,
if (i>mm.length-1) {
i = 0;
}
list_mmc.list_p.list.selectedIndex = i;
dd.loadSound(mm*, true);
if (noprenext) {
noplay();
}
}
//fscommand(“allowscale”, “false”);
xx = bar._width;
orginal_width = bar._width;
soundbtndis._visible = false;
soundbtndis.disabled = true;
dd.setVolume(200);
onEnterFrame = function() {
dd.onSoundComplete = function() {
startoff();
playnext();
};
t1 = int(dd.duration/1000/60);
t1 = t1+" : “+int((dd.duration/1000-(t1*60)));
ddf = int((dd.duration-dd.position)/1000/60);
elapsed_sec = int((((dd.duration-dd.position)/1000/60)-ddf)*60);
if (elapsed_sec<10) {
elapsed_sec = “0”+elapsed_sec;
}
if (ddf<10) {
ddf = “0”+ddf;
}
if (stpd) {
elapsed = t1;
} else {
elapsed = ddf+” : “+elapsed_sec;
}
//mo=dd.position/1000
//elapsed =
vol = dd.getVolume()+” %";
dur = dd.duration;
pos = dd.position;
per = (pos/dur)*100;
m = (pos/dur)100;
bar._width = (mxx)/100;
drag._x = bar._width+ bar._x;
//drag._y = 136;
if (stpd) {
xx = 0;
} else {
xx = orginal_width;
}
// function keys
if (Key.isDown(67)) {
pauseit();
}
if (Key.isDown(88)) {
playit();
}
if (Key.isDown(86)) {
stopit();
}
shorba.art = "Artist :"+dd.id3.artist;
shorba.song = "Title :"+dd.id3.songname;
shorba.setMask(loo7);
// Handling undefined or null Tag values
// Note this works with URL form like that d:\songs\song.mp3
if (shorba.art == "Artist :"+undefined || shorba.art == "Artist :"+'') {
shorba.art = String(mm*);
dotpos = shorba.art.lastIndexOf('.');
slashpos = shorba.art.lastIndexOf('\\');
shorba.art = "Artist :"+ shorba.art.substring(slashpos+1, dotpos);
}
if ( shorba.song == "Title :"+undefined || shorba.song == "Title :"+'') {
shorba.song = String(mm*);
dotpos = shorba.song.lastIndexOf('.');
slashpos = shorba.song.lastIndexOf('\\');
shorba.song = "Title :"+ shorba.song.substring(slashpos+1, dotpos);
}
};
information.setMask(infomask);
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>