Cita:
es una precarga para archivos externos this.createEmptyMovieClip("progressBar_mc", 0);
progressBar_mc.createEmptyMovieClip("bar_mc", 1);
progressBar_mc.createEmptyMovieClip("stroke_mc", 2);
with (progressBar_mc.stroke_mc) {
lineStyle(0, 0x000000);
moveTo(0, 0);
lineTo(51, 0);
lineTo(51, 2);
lineTo(0, 2);
lineTo(0, 0);
}
with (progressBar_mc.bar_mc) {
beginFill(0xff0000, 51);
moveTo(0, 0);
lineTo(51, 0);
lineTo(51, 2);
lineTo(0, 2);
lineTo(0, 0);
endFill();
_xscale = 0;
}
progressBar_mc._x = 2;
progressBar_mc._y = 20;
//
var mclListener:Object = new Object();
mclListener.onLoadStart = function(target_mc:MovieClip) {
progressBar_mc.bar_mc._xscale = 0;
};
mclListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
progressBar_mc.bar_mc._xscale = Math.round(bytesLoaded/bytesTotal*100);
};
mclListener.onLoadComplete = function(target_mc:MovieClip) {
progressBar_mc.removeMovieClip();
};
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc._height = 67;
target_mc._width = 53;
};
this.createEmptyMovieClip("image_mc", 100);
var nocache:String;
nocache = "?nocache = " + Math.random(5682)
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("pelicula.swf"+nocache, image_mc);
progressBar_mc.createEmptyMovieClip("bar_mc", 1);
progressBar_mc.createEmptyMovieClip("stroke_mc", 2);
with (progressBar_mc.stroke_mc) {
lineStyle(0, 0x000000);
moveTo(0, 0);
lineTo(51, 0);
lineTo(51, 2);
lineTo(0, 2);
lineTo(0, 0);
}
with (progressBar_mc.bar_mc) {
beginFill(0xff0000, 51);
moveTo(0, 0);
lineTo(51, 0);
lineTo(51, 2);
lineTo(0, 2);
lineTo(0, 0);
endFill();
_xscale = 0;
}
progressBar_mc._x = 2;
progressBar_mc._y = 20;
//
var mclListener:Object = new Object();
mclListener.onLoadStart = function(target_mc:MovieClip) {
progressBar_mc.bar_mc._xscale = 0;
};
mclListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
progressBar_mc.bar_mc._xscale = Math.round(bytesLoaded/bytesTotal*100);
};
mclListener.onLoadComplete = function(target_mc:MovieClip) {
progressBar_mc.removeMovieClip();
};
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc._height = 67;
target_mc._width = 53;
};
this.createEmptyMovieClip("image_mc", 100);
var nocache:String;
nocache = "?nocache = " + Math.random(5682)
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("pelicula.swf"+nocache, image_mc);
gracias