Just for a short second it shows the number 100 before it starts counting up to 100. Why?
// TYPE OF TWEENS
var tweentype_resize:String = "easeOutExpo";
var tweentype_fadeOut:String = "easeInSine";
var tweentype_fadeIn:String = "easeInSine";
// SPEED OF TWEENS
var speed_resize:Number = 0.4;
var speed_fadeOut:Number = 0.4;
var speed_fadeIn:Number = 0.4;
// BUTTONS
function hitButton(nbrID) {
btn = _root.nav["btn"+nbrID];
btn.nbrID = nbrID;
btn.onRollOver = function() {
this.alphaTo(100, speed_fadeIn);
};
btn.onRollOut = function() {
this.alphaTo(30, speed_fadeOut);
};
btn.onRelease = function() {
for (var i = 1; i<=20; i++) {
_root.nav["btn"+i].alphaTo(30, speed_fadeOut);
_root.nav["btn"+i].enabled = true;
}
this.alphaTo(100, speed_fadeIn);
this.enabled = false;
fadeOut(this.nbrID-1);
}
}
for (var i = 1; i<=20; i++) {
_root.hitButton(i);
}
// IMAGE VIEWER
bar._visible = false;
containerMC._alpha = 0;
picinfo._alpha = 0;
containerMC.swapDepths(2);
MovieClip.prototype.loadPic = function(pic) {
this.loadMovie(pArray[pic]);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = true;
per = Math.round((l/t)*100);
if (t == l && containerMC._width>0 && containerMC._height>0) {
var w = containerMC._width, h = containerMC._height;
resizeMe(w, h);
bar._visible = false;
picInfo.text = tArray[pic];
if (picInfo.text == "undefined") {
picInfo._visible = false;
} else {
picInfo._visible = true;
}
delete this.onEnterFrame;
} else {
//bar._width = w;
bar.preInfo.text = per;
}
}
}
function resizeMe(w, h) {
//border tween:
border.tween(["_width", "_height"], [w, h], speed_resize, tweentype_resize);
//pic and picinfo fade in:
containerMC.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_resize);
picInfo.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
//pic position:
containerMC._x = border._x;
containerMC._y = border._y;
}
//LOAD CSS
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
cssStyles.onLoad = function (success:Boolean):Void {
if (success) {
picInfo.styleSheet = cssStyles;
} else {
picInfo.text = "Texten kunde inte laddas.";
}
}
cssStyles.load ("styles/styles.css");
// LOAD XML
picInfo._alpha = 0;
picInfo.html = true;
picInfo.multiline = true;
picInfo.wordWrap = true;
picInfo.autoSize = "left";
var pArray = new Array();
var tArray = new Array();
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
if (success) {
trace("success: "+this.status);
var xmlData = this.firstChild;
for (var i = 0; i<xmlData.childNodes.length; i++) {
pArray.push(xmlData.childNodes*.childNodes[0].firstChild.nodeValue);
tArray.push(xmlData.childNodes*.childNodes[1].firstChild.nodeValue);
}
// navigation
var picNum = parseInt(i);
for (var i = 1; i<=picNum; i++) {
_root.nav["btn"+i].topText_mc.text = *;
_root.nav["btn"+i].alphaTo(30, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
}
_root.nav.btn1.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
_root.nav.btn1.enabled = false;
// load pictures
containerMC.loadPic(0);
picInfo.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
} else {
picInfo.text = "Texten kunde inte laddas.";
}
}
myXML.load("main"+num+"/xml/sub"+itemnum+".xml")
//FADE OUT IMAGES AND TEXT
function fadeOut(pic) {
containerMC.alphaTo(0, speed_fadeOut, tweentype_fadeOut, 0, {scope:containerMC, func:containerMC.loadPic, args:[pic]});
picInfo.alphaTo(0, speed_fadeOut, tweentype_fadeOut);
}