Instance of Symbol 3 MovieClip [JCPreloaderMC] in Frame 1
//component parameters
onClipEvent (initialize) {
proceedAt = 99;
showBar = true;
showText = true;
mcToPlay = "";
color2 = 13421772 /* 0xCCCCCC */;
color1 = 6710886 /* 0x666666 */;
color4 = 10066329 /* 0x999999 */;
color3 = 3355443 /* 0x333333 */;
color5 = 0;
sp = 2;
lineWidth = 1;
}
Frame 99
gotoAndPlay (2);
Symbol 3 MovieClip [JCPreloaderMC] Frame 1
#initclip 1
function JCPreloaderClass() {
this.orgWidth = 100;
this.orgHeight = 20;
this.factor = 0;
this.proceedAt = 99;
this.spacer = 2;
this.init();
}
JCPreloaderClass.prototype = new MovieClip();
JCPreloaderClass.prototype.init = function () {
this.orgWidth = this._width;
this.orgHeight = this._height;
this._xscale = (this._yscale = 100);
this.boundingBox_mc._visible = false;
this.setSize(this.orgWidth, this.orgHeight);
this._x = parseInt(this._x);
this._y = parseInt(this._y);
this.txtAttrib = new TextFormat();
this.txtAttrib.color = 0;
this.txtAttrib.font = "_sans";
this.txtAttrib.embedFonts = false;
this.txtAttrib.size = (this.orgHeight / 2) + 3;
this.txtAttrib.align = "center";
if (this.mcToPlay ne "") {
this.playMC = this._parent[this.mcToPlay];
this.playMCLength = this.playMC._totalframes;
}
this.onEnterFrame = function () {
this.bLoaded = this._parent.getBytesLoaded();
this.bTotal = this._parent.getBytesTotal();
this.factor = Math.ceil((this.bLoaded / this.bTotal) * 100);
if (this.factor < this.proceedAt) {
var _local2 = (this.factor * this.playMCLength) / 100;
this.playMC.gotoAndStop(_local2);
this._parent.stop();
} else if (!this.thisIsThepreview) {
this._parent.play();
}
this.redraw();
if (this.thisIsThepreview) {
this.onEnterFrame = null;
}
};
};
JCPreloaderClass.prototype.setSize = function (w, h) {
this.orgWidth = w;
this.orgHeight = h;
this.boundingBox_mc._width = w;
this.boundingBox_mc._height = h;
this.redraw();
};
JCPreloaderClass.prototype.redraw = function () {
this.setText();
this.clear();
if (this.showBar) {
var _local3 = (this.factor * this.orgWidth) / 100;
var _local2 = this.orgHeight;
var _local4 = this.orgWidth;
this.drawRectangle(this.sp * -1, this.orgWidth + this.sp, this.sp * -1, this.orgHeight + this.sp, this.color5, this.color5, 100, false);
if (this.factor > 0) {
this.drawRectangle(0, _local3, 0, _local2, this.color1, this.color2, 100, true);
}
if (this.factor < 100) {
this.drawRectangle(_local3, _local4, 0, _local2, this.color3, this.color4, 100, true);
}
}
};
JCPreloaderClass.prototype.setText = function () {
if (this.thisIsThepreview) {
this.factor = random(100);
}
if (this.showText) {
if (this.factor < this.proceedAt) {
this.percentloaded = this.factor + "% loaded";
} else {
this.percentloaded = "Loading complete!";
}
} else {
this.percentloaded = "";
}
this.fontSize = (this.orgHeight / 2) + 3;
this.txtAttrib.size = this.fontSize;
this.yOffsetText = ((this.orgHeight / 2) - (this.fontSize / 2)) - 2;
this.createTextField("percentTxt", 9, 0, this.yOffsetText, this.orgWidth, this.orgHeight + 3);
this.percentTxt.setNewTextFormat(this.txtAttrib);
this.percentTxt.text = this.percentloaded;
this.percentTxt.selectable = false;
};
JCPreloaderClass.prototype.drawRectangle = function (x1, x2, y1, y2, lineCol, fillCol, trans, shallWeFill) {
this.lineStyle(this.lineWidth, lineCol);
if (shallWeFill) {
this.beginFill(fillCol, trans);
}
this.moveTo(x1, y1);
this.lineTo(x2, y1);
this.lineTo(x2, y2);
this.lineTo(x1, y2);
this.lineTo(x1, y1);
if (shallWeFill) {
this.endFill();
}
};
JCPreloaderClass.prototype.getLabel = function () {
return(this.fLabel_mc.labelField.text);
};
JCPreloaderClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
this.arrangeLabel();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
JCPreloaderClass.prototype.setClickHandler = function (chng, obj) {
this.handlerObj = ((arguments.length < 2) ? (this._parent) : (obj));
this.clickHandler = chng;
};
JCPreloaderClass.prototype.executeCallBack = function () {
this.handlerObj[this.clickHandler](this);
};
Object.registerClass("JCPreloaderMC", JCPreloaderClass);
#endinitclip