# If(percentage.text =\> '0%'){ loadText.text = 'Loading Juicy Overflows';

**URL:** <https://forum.kirupa.com/t/if-percentage-text-0-loadtext-text-loading-juicy-overflows/217055>\
**Category:** Uncategorized\
**Created:** [February 22, 2007, 4:57pm UTC](https://forum.kirupa.com/t/if-percentage-text-0-loadtext-text-loading-juicy-overflows/217055 "2007-02-22T16:57:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shillin22](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@shillin22](https://forum.kirupa.com/u/shillin22)\
**Post date:** [February 22, 2007, 4:57pm UTC](https://forum.kirupa.com/t/if-percentage-text-0-loadtext-text-loading-juicy-overflows/217055/1 "2007-02-22T16:57:09Z")

</div>

I would like my preloader to load various phrases using loadText.text =’’; based on the percentage loaded…

The phrases should be locked to the percentage of loading. For example:  
0-24% “loading frogs”  
25-49% “loading paddles”  
50-74% “loading trucks”  
75-99% “loading good times”  
100% “complete”

My code is below:  
I was trying to use something like this…

```
Code:
if(percentage.text =&gt; '0%'){
loadText.text = 'Loading Juicy Overflows'; 

```

existing code:  
Code:  
stop();  
//  
//file to be loaded:  
var loadFile:String = “flash/flav\_o\_rama.swf”;  
//list of MCs on the stage and order they should be tweened in:  
var blend\_sound:Sound = new Sound(this);  
blend\_sound.attachSound(“blend”);  
var slot\_sound:Sound = new Sound(this);  
slot\_sound.attachSound(“slot”);  
var mcList:Array = new Array(‘blender’, ‘plusSign’, ‘slotMachine’);  
//  
import mx.transitions.Tween;  
import mx.transitions.easing._;  
//  
var isloaded:Boolean = false;  
var animationDone:Boolean = false;  
var listCount:Number = 0;  
var text:Number = 0;  
percentage.text = ‘0%’;  
//  
//hide stuff for later fade in:  
for (var i:Number = 0; i\<mcList.length; i++) {  
this[mcList_].\_alpha = 0;  
}  
//loadText  
if(percentage.text =\> ‘0%’){  
loadText.text = ‘Loading Juicy Overflows’;

} else if(percentage.text =\> ‘25%’){  
loadText.text = ‘Loading Luck’;

}

//  
tweenIn();  
function tweenIn():Void {  
if(mcList[listCount] == ‘blender’){  
[//loadText.text](https://loadText.text) = ‘Loading Juicy Overflows’;  
blend\_sound.start();

} else if(mcList[listCount] == ‘slotMachine’){  
[//loadText.text](https://loadText.text) = ‘Loading Luck’;  
slot\_sound.start();  
}

```
this[mcList[listCount]]._alpha = 100;
new Tween(this[mcList[listCount]], '_xscale', Bounce.easeOut, 0, 100, 12, false);
var twn:Tween = new Tween(this[mcList[listCount]], '_yscale', Bounce.easeOut, 0, 100, 12, false);
twn.onMotionFinished = function():Void {
	listCount++;
	if (mcList[listCount]) {
		tweenIn();
	} else {
		animationDone = true;
	}
};

```

}  
//  
this.onEnterFrame = function():Void {  
if (isloaded && animationDone) {  
for (var i:Number = 0; i\<mcList.length; i++) {  
this[mcList\*].\_alpha -= 8;  
}  
percentage.\_alpha = loadText.\_alpha -= 8;  
if (percentage.\_alpha\<0) {  
loadContainer.play();  
for (var i:Number = 0; i\<mcList.length; i++) {  
this[mcList\*].swapDepths(this.getNextHighestDepth());  
this[mcList\*].removeMovieClip();  
}  
delete this.onEnterFrame;  
}  
}  
};  
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
//LOADING OF MOVIE:  
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
//we’ll load the movie into “loadloadContainer”:  
this.createEmptyMovieClip(‘loadContainer’, this.getNextHighestDepth());  
var loadListener:Object = new Object();  
loadListener.onLoadComplete = function() {  
//trace(“onLoadComplete called”);  
};  
loadListener.onLoadProgress = function(target:MovieClip, loadedBytes:Number, totalBytes:Number):Void {  
percentage.text = Math.round(100\*(loadedBytes/totalBytes))+"%";  
};  
loadListener.onLoadInit = function(target:MovieClip) {  
percentage.text = ‘100%’;  
loadText.text = ‘Loading Complete’;  
isloaded = true;  
//trace(“finished download”);  
};  
var movLoader:MovieClipLoader = new MovieClipLoader();  
movLoader.loadClip(loadFile, loadContainer);  
movLoader.addListener(loadListener);

```
	 	 		 		 		 		 		 	 	   	 		 [IMG]http://www.actionscript.org/forums/images/statusicon/user_online.gif[/IMG] [[IMG]http://www.actionscript.org/forums/images/buttons/report.gif[/IMG] [IMG]http://www.actionscript.org/forums/images/misc/progress.gif[/IMG] [URL="http://www.actionscript.org/forums/editpost.php3?do=editpost&p=582098"][IMG]http://www.actionscript.org/forums/images/buttons/edit.gif[/IMG] [URL="http://www.actionscript.org/forums/newreply.php3?do=newreply&p=582098"][IMG]http://www.actionscript.org/forums/images/buttons/quote.gif[/IMG] [URL="http://www.actionscript.org/forums/newreply.php3?do=newreply&p=582098"][IMG]http://www.actionscript.org/forums/images/buttons/multiquote_off.gif[/IMG] [URL="http://www.actionscript.org/forums/newreply.php3?do=newreply&p=582098"][IMG]http://www.actionscript.org/forums/images/buttons/quickreply.gif[/IMG]](http://www.actionscript.org/forums/report.php3?p=582098) shillin22
 	 		[View Public Profile](http://www.actionscript.org/forums/member.php3?u=47730)
 	 		[Send a private message to shillin22](http://www.actionscript.org/forums/private.php3?do=newpm&u=47730)
 	 	 	 		[Find More Posts by shillin22](http://www.actionscript.org/forums/search.php3?do=finduser&u=47730)
 	 	[Add shillin22 to Your Buddy List](http://www.actionscript.org/forums/profile.php3?do=addlist&userlist=buddy&u=47730)
 	 
	 	 			 	           	 		       	 		[[IMG]http://www.actionscript.org/forums/images/buttons/reply.gif[/IMG]](http://www.actionscript.org/forums/newreply.php3?do=newreply&noquote=1&p=582098) 		 	        

```

[CENTER] **«** [Previous Thread | [URL=“http://www.actionscript.org/forums/showthread.php3?t=129073&goto=nextnewest”]Next Thread](http://www.actionscript.org/forums/showthread.php3?t=129073&goto=nextoldest) **»** [/CENTER]

var mqlimit = 0; vBulletin Message

```
[Cancel Changes](http://www.actionscript.org/forums/showthread.php3?t=129073#)
                                 	 		 			[[IMG]http://www.actionscript.org/forums/images/buttons/collapse_tcat.gif[/IMG]](http://www.actionscript.org/forums/showthread.php3?t=129073#top) Quick Reply The following errors occurred when this message was submitted

[Okay](http://www.actionscript.org/forums/showthread.php3?t=129073#)
```
