hey, i’m having a strange problem:
i set a function:
MovieClip.prototype.thumbLoadbar = function(a) {
trace(“hello”)
var t = _root.thumbtotal;
var l = _root.thumbloaded;
_root.thumbloaded += a;
trace(l);
getPercent = (l/t);
if (t>0) {
_root.thumbbar._width = getPercent110;
_root.thumbText.text = Math.round(getPercent100)+"%";
}
if (t>0 && t == l) {
trace(“loaded”);
}
};
and call this function with this clip in wich a JPG is being loaded:
onClipEvent (load) {
l = this.getBytesLoaded();
t = this.getBytesTotal();
p = this;
if (t>0 && t == l) {
w = p._width/-2;
h = p._height/-2;
p._x = w;
p._y = h;
_root.thumbLoadbar(t);
trace("bytes = "+ t);
}
}
now, with this set-up the function thumbloadbar is called, but ofcourse the data (t) sent the first time is not the data from the JPG (2500 bytes) but from the empty clip (12 bytes).
the function is only called while the bytes dont exceed 12 bytes, when it gets more, it just doesnt call it anymore for some reason, but the “IF” action does still work(because it still traces ("bytes = "+t)), so it should just call the function, shouldnt it? When i change onClipEvent(load) to (data), the function is not called at all
whats wrong with my script?