проблема с аs....может кто подскажет что не так делаю.…
картинка должна подгружaться в 8 мувиков, последователньо
function loadImage(loadingTarget, progressBarName, fileName) {
//loadingTarget - instance of place, progressBarName - loader, fileName - jpg
this.onEnterFrame = function() {
fadeInc = 10;
fade = 0;
loadMovie(fileName, this[loadingTarget]);
//jpg loading
var loadObj = this[loadingTarget];
var initObject = {_x:this[loadingTarget]._x=0, _y:this[loadingTarget]._y=0, target:loadObj, loadExit:null};
this[loadingTarget].attachMovie("loader", "loader", 2, initObject);
//loader- linked object of loader in Library
this[loadingTarget]._alfa = fade;
this.onEnterFrame = function() {
//plavnoe pojavlenie risunka
fade += fadeInc;
if (fade<=100) {
this[loadingTarget]._alpha = fade;
} else if (fade>100) {
this.onEnterFrame = undefined;
// udalenie onEnterFrame
}
};
};
}
_root.onEnterFrame = function() {
for (i=0; i<=8; i++) {
loadImage("_root.container"+i, "loader", "5160s.jpg"); //container-movie clip, holder of jpg, loader-preloader linked in library
}
};
_root.onEnterFrame = undefined;
код внутри прелоадера
function checkLoad(obj) {
var lBytes = target.getBytesLoaded();
var tBytes = target.getBytesTotal();
var percentLoaded = Math.floor((lBytes/tBytes)*100);
bar._xscale = percentLoaded;
percent.text = Math.floor(percentLoaded)+"% of "+Math.floor(tBytes/1024)+"KB loaded.";
if (lBytes>=tBytes && tBytes>0) {
if (count>=12) {
clearInterval(checkProgress);
_parent[loadExit]();
obj.removeMovieClip();
} else {
count++;
}
}
updateAfterEvent();
}
checkProgress = setInterval(checkLoad, 100, this);
stop();