Salve a tutti,
ho un problema con questo script non capisco come evitare che le canzoni si interrompano e non proseguino appena finisce il primo loop. Infatti al termine del primo ha bisogno che io prema col tasto per far partire la secondo canzone e cosi via per la terza etc etc.
Qualcuno mi puo aiutare mi sta facendo sbiellare
Codice PHP:fscommand( "fullscreen", true );
Stage.scaleMode = "noScale";
Stage.align = "TL";
#include "mc_tween2.as"
//you can separate a lot of songs with a simple "|"
mp3 = "1.mp3|2.mp3|3.mp3";
//autostart first song 1=true
autostart=1;
function s2time(d)
{
if (d > 60)
{
s = d % 60;
if (s < 10)
{
s = "0" + s;
} // end if
var _l1 = (d - d % 60) / 60 + ":" + s;
} // end if
return(_l1);
} // End of the function
function updateseeker()
{
if (_root.seeker._alpha < 100)
{
_root.seeker._alpha = _root.seeker._alpha + 10;
} // end if
_root.sposition = _global.Behaviors.Sound.arf.position / _global.Behaviors.Sound.arf.duration * 100;
_root.seeker.gotoAndStop(Math.round(sposition * 5));
if (_root.showtime)
{
p = Math.round(_global.Behaviors.Sound.arf.position / 1000);
d = Math.round(_global.Behaviors.Sound.arf.duration / 1000);
_root.descr = s2time(p) + " | " + s2time(d);
}
else
{
_root.descr = Math.round(_global.Behaviors.Sound.arf.position / 1000) + " | " + Math.round(_global.Behaviors.Sound.arf.duration / 1000);
} // end if
} // End of the function
function fadeseeker()
{
if (_root.seeker._alpha > 0)
{
_root.seeker._alpha = _root.seeker._alpha - 5;
}
else
{
clearInterval(fadeseeker_interval);
} // end if
} // End of the function
function updatevol()
{
decal = (_root._xmouse - _root.volumecontrol._x) / _root.volumecontrol.fond._width * 100;
decal = Math.round(decal);
_root.volume = decal;
if (_root.isplaying)
{
_global.Behaviors.Sound.arf.setVolume(decal);
} // end if
if (decal >= 0 && decal <= 100)
{
_root.volumecontrol.gotoAndStop(decal);
} // end if
} // End of the function
function setvc()
{
_root.uv = setInterval(updatevol, interval / 2);
} // End of the function
function releasevc()
{
clearInterval(_root.uv);
} // End of the function
function dewnext()
{
equa.w.gotoAndStop(1);
current++;
if (current > size - 1)
{
current = 0;
} // end if
dewload();
dewstop();
equa.w.gotoAndStop(1);
} // End of the function
function dewprev()
{
current--;
if (current < 0)
{
current = size - 1;
} // end if
dewload();
} // End of the function
function dewload()
{
mp3file = mp3[current];
if (_global.Behaviors == null)
{
_global.Behaviors = {};
} // end if
if (_global.Behaviors.Sound == null)
{
_global.Behaviors.Sound = {};
} // end if
if (typeof(this.createEmptyMovieClip) == "undefined")
{
this._parent.createEmptyMovieClip("BS_arf", new Date().getTime() - Math.floor(new Date().getTime() / 10000) * 10000);
_global.Behaviors.Sound.arf = new Sound(this._parent.BS_arf);
}
else
{
this.createEmptyMovieClip("_arf_", new Date().getTime() - Math.floor(new Date().getTime() / 10000) * 10000);
_global.Behaviors.Sound.arf = new Sound(this.BS_arf);
} // end if
if (volume > 0)
{
_global.Behaviors.Sound.arf.setVolume(volume);
} // end if
_global.Behaviors.Sound.arf.onSoundComplete = function ()
{
if (autoreplay == 1 || autoreplay == "true" || autoreplay == "yes")
{
_root.isplaying = false;
_root.sposition = 0;
dewplay();
}
else if (size > 1)
{
dewnext();
}
else
{
dewstop();
equa.w.gotoAndStop(1);
} // end if
};
_global.Behaviors.Sound.arf.loadSound(mp3file, true);
_global.Behaviors.Sound.arf.start();
_root.loaded = true;
_root.isplaying = true;
dewplay();
} // End of the function
function dewplay()
{
if (!_root.loaded)
{
dewload();
} // end if
position = _root.sposition * (_global.Behaviors.Sound.arf.duration / 100000);
if (!_root.isplaying)
{
_global.Behaviors.Sound.arf.start(position, 1);
} // end if
clearInterval(fadeseeker_interval);
clearInterval(updateseeker_interval);
updateseeker_interval = setInterval(updateseeker, interval);
_root.btnhelp._visible = false;
_root.isplaying = true;
btnplay._visible = false;
btnpause._visible = true;
btnstop._visible = true;
equa.w.gotoAndPlay(2);
if (position==1)
{
equa.w.gotoAndPlay(1);
}
} // End of the function
function dewpause()
{
equa.w.gotoAndStop(1);
btnplay._visible = true;
btnpause._visible = false;
btnstop._visible = true;
_root.sposition = _global.Behaviors.Sound.arf.position / 1000;
_global.Behaviors.Sound.arf.stop();
_root.isplaying = false;
} // End of the function
function dewstop()
{
btnplay._visible = true;
btnpause._visible = false;
btnstop._visible = false;
_global.Behaviors.Sound.arf.stop();
clearInterval(updateseeker_interval);
_root.sposition = 0;
fadeseeker_interval = setInterval(fadeseeker, interval);
_root.isplaying = false;
} // End of the function
var sposition = 0;
var fadeseeker_interval;
var updateseeker_interval;
var interval = 50;
var isplaying = false;
var loaded = false;
btnplay._visible = true;
btnpause._visible = false;
btnstop._visible = false;
bg._visible = false;
btnplay.onRelease = dewplay;
btnpause.onRelease = dewpause;
btnstop.onRelease = dewstop;
btnnext.onRelease = dewnext;
btnprev.onRelease = dewprev;
if (!volume)
{
volume = 100;
} // end if
if (volume > 0)
{
_root.volumecontrol.gotoAndStop(volume);
} // end if
fond.onPress = function ()
{
if (_root.isplaying)
{
decal = (_root._xmouse - _root.fond._x) / _root.fond._width;
decal = _global.Behaviors.Sound.arf.duration * decal / 1000;
if (decal > 0)
{
_global.Behaviors.Sound.arf.start(decal, 1);
} // end if
} // end if
};
volumecontrol.onMouseDown = function ()
{
setvc();
};
volumecontrol.onMouseUp = function ()
{
releasevc();
};
if (mp3 == undefined)
{
if (file)
{
mp3 = file;
}
else if (sound)
{
mp3 = sound;
}
else if (son)
{
mp3 = son;
} // end if
} // end if
mp3 = mp3.split("|");
var current = 0;
var size = mp3.length;
if (size < 2 || size == undefined)
{
btnprev._visible = false;
btnnext._visible = false;
} // end if
if (size == undefined)
{
btnplay._visible = false;
descr = "no mp3 file";
} // end if
if (autostart == 1 || autostart == "true" || autostart == "yes" || autoplay == 1 || autoplay == "true" || autoplay == "yes")
{
dewload();
} // end if
stageInit= function() {
onR( "BR", equa );
onR( "BR", btnplay );
onR( "BR", btnpause );
onR( "CC", info);
}
Stage.addListener( stageL );
var stageL:Object = new Object();
stageL.onResize = function() {
onR( "BR", equa );
onR( "BR", btnplay );
onR( "BR", btnpause );
onR( "CC", info);
}
Stage.addListener( stageL );
// Am I the very first poster in 2007 ?
// trigger alignment via Stage listener object!
// alignment options: "TL", "TR", "TC", "BL", "BR", "BC", "CL", "CR", "CC"
// optional offset by X or Y axis provided as an object property: obj.X, obj.Y
function onR( A, obj ) {
var F = String( A ).substring( 0, 1 );
var L = String( A ).substring( 1, 2 );
( obj.X == undefined ) ? obj.X = 0 : obj.X = obj.X;
( obj.Y == undefined ) ? obj.Y = 0 : obj.Y = obj.Y;
if( F == "T" ) obj._y = Math.ceil( obj.Y );
else if( F == "B" ) obj._y = Math.ceil( Stage.height - obj._height - obj.Y );
else if( F == "C" ) obj._y = Math.ceil( ( Stage.height - obj._height ) / 2 - obj.Y );
if( L == "L" ) obj._x = Math.ceil( obj.X );
else if( L == "R" ) obj._x = Math.ceil( Stage.width - obj._width - obj.X );
else if( L == "C" ) obj._x = Math.ceil( ( Stage.width - obj._width ) / 2 - obj.X );
}
this.stageInit();
![]()
![]()

Rispondi quotando