Scena Preload
Frame 2
Clip Preload
onClipEvent (load) {
fscommand ("allowscale", "false");
_root.stop();
loadMovieNum("musica.swf",1);
_level1.stop();
_root.snd = new Sound(_level1);
_root.snd.setVolume(0);
car = _level1.getBytesLoaded();
tot = _level1.getBytesTotal();
if (_level1.getBytesLoaded() == _level1.getBytesTotal()) {
_level1.stop();_root.play()
} else {
// non ha finito di caricare
carica = true;
}
}
onClipEvent (enterFrame) {
if (carica) {
car = _level1.getBytesLoaded();
tot = _level1.getBytesTotal();
// se ha finito di caricare
if (car == tot) {
_root.play();
} else {
// altrimenti via alla grafica preload
barra._xscale = Math.round((car/tot)*100)/2;
}
}
}

Rispondi quotando