Hi im having huge diemmas.
I have a script for loading pcitures into thumbnails which works perfect locally, but over the net it is very chunky and slow. Anyway to cut a long story short ive tried to implement a preloader, which is quiet simply is dynamically created textfield attached to each thumb with download progress displayed. Its almost like I need a preloader for the preloader though, lol. It seems the textfield only gets created at the same time the thumbnail pic appears?
Here’s a snippet of my code…
............
..............
curr_thumb.loadMovie(curr_thumb.variables);
preload(curr_thumb);
}
//_root.scrollpane_cmp.setScrollContent(curr_gallery);
};
// var count = 0;
preload = function (curr_thumb) {
var curr_dummy = curr_thumb._parent.createEmptyMovieClip("dummy"+curr_thumb.index+"_mc", curr_thumb.depth+1);
curr_dummy.createTextField("label"+curr_thumb.index+"_txt", 0,curr_thumb._x,curr_thumb._y,600,600);
curr_dummy["label"+curr_thumb.index+"_txt"].text = curr_thumb.index;
//curr_thumb.label.text="hello";
trace("curr_thumb parent: " + curr_thumb._parent);
trace("parent's depth: " +depth);
trace("preload "+container);
curr_dummy.onEnterFrame = function() {
var t = curr_thumb.getBytesTotal(), l = curr_thumb.getBytesLoaded();
if (t && !isNaN(t)) {
var percent = Math.round(l*100/t);
if (l == t) {
trace("loading complete");
curr_thumb._width = 174;
curr_thumb._height = 112;
curr_thumb.onRollOver = curr_thumb.onDragOver=selectThumb;
curr_thumb.onRollOut = curr_thumb.onDragOut=deselectThumb;
curr_thumb.onRelease = activateThumb;
this.removeMovieClip();
} else {
trace("loading "+percent+" %");
curr_dummy["label"+curr_thumb.index+"_txt"].text = percent+" %";
}
}
};