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