Originariamente inviato da yag
//se in futuro decido di ereditare
#initclip 0
function cmpPreload() {
this._visible = false;
this.setevEndPreload(this.evEndPreload);
}
cmpPreload.prototype = new MovieClip();
Object.registerClass("fcmpPreload", cmpPreload);
//metodi
cmpPreload.prototype.preload = function() {
this.Total = this._parent[this.mc].getBytesTotal();
this.Charge = this._parent[this.mc].getBytesLoaded();
//trace(this.Charge +","+this.Total);
//this._parent.pippo.text +="\n";
//this._parent.pippo.text +=this.Charge;
this._parent[this.mcprogress].setByteTotal(this.Total);
this._parent[this.mcprogress].setByteParzial(this.Charge);
if (this.Charge>=this.Total) {
this.callEndPreload();
stop();
} else {
}
};
cmpPreload.prototype.setMc = function(p) {
this.mc = p;
};
cmpPreload.prototype.getMc = function() {
return this.mc;
};
cmpPreload.prototype.setMcprogress = function(p) {
this.mcprogress = p;
};
cmpPreload.prototype.getMcprogress = function() {
return this.mcprogress;
};
//eventi
cmpPreload.prototype.setevEndPreload = function(chng, obj) {
this.handlerObj = (arguments.length<2) ? this._parent : obj;
this.evEndPreload = chng;
};
cmpPreload.prototype.callEndPreload = function() {
this.handlerObj[this.evEndPreload](this);
};
#endinitclip