i create one loader but not work fine …
sees:
loader._alpha = 0;
//#
function preload(file) {
cont.alphaTo(0,1);
cont.loadMovie(_global.path + file);
onEnterFrame = function() {
var cT:Number = Math.round(cont.getBytesTotal());
var cL:Number = Math.round(cont.getBytesLoaded());
var gB:Number = cL/cT*100;
var lx:Number = ((Stage.width/2) - (loader._width/2));
var ly:Number = ((Stage.height/2) - (loader._height/2));
if (cT > cL) {
loader.tween("_x", lx, 1);
loader.tween("_y", ly, 1);
loader.alphaTo(100, 1);
loader.tx.text = int(gB);
loader.bar._width = gB;
} else {
loader.tween("_x", 10, 1);
loader.tween("_y", 10, 1);
loader.alphaTo(0,1);
cont.alphaTo(100, 1);
delete onEnterFrame;
}
}
}
//---------------------------------- BUT
empresa.tx = "A EMPRESA";
empresa.onRelease = function() {
preload("empresa.jpg");
};
//#
cases.tx = "CASES";
cases.onRelease = function() {
preload("cases.jpg");
};
in my opinion the code is certain, but when I compel the archive and when click in the first button it quickly appears the image and soon it disappears and still a click in another button does not function as, preload does not appear normally.
:q:
Help me.