To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash MX

Reply
 
Thread Tools Search this Thread Display Modes
Old 08-11-2003, 04:21 PM   #1
ericflash
Senior Member
 
Join Date: Apr 2001
Posts: 940
_level Loader

I have this loader set up but it won't recognize the level in order to get the bytesloaded and bytesTotal. I am sending the level as a parameter to the function
Code:
//====== Inital Level Loader ===============
levelLoader = function (file, level) {
	lev = "_level"+level;
	loader_holder._x = 600.0;
	loadMovieNum(file, level);
	trace("LEV   :"+lev);
	progressCheck.onEnterFrame = function() {
		var percent = (lev.getBytesLoaded()/lev.getBytesTotal())*100;
		if (!isNan(percent)) {
			_root.loader_holder.bar._xscale = percent;
		} else {
			trace("0% loaded");
		}
		if (percent == 100 && lev.getBytesLoaded()>1) {
			delete progressCheck.onEnterFrame;
			loader_holder._x = 846.0;
			trace("LEVEL: "+level+"      "+"IS FULLY LOADED");
		}
	};
};
levelLoader("squares.swf", 9);
Why will this not work? The lev variable is not been read as a path but as a string. I have even used the [] operator to access the level but no joy. Can anyone help?
ericflash is offline   Reply With Quote
Old 08-11-2003, 05:06 PM   #2
oldnewbie
Banned
 
Join Date: Apr 2001
Location: Montréal, Québec.
Posts: 25,397
This one seems to work...

Code:
//====== Inital Level Loader ===============
levelLoader = function (file, level) {
	lev = "_level"+level;
	loader_holder._x = 600.0;
	loadMovieNum(file, level);
	trace("LEV   :"+lev);
	progressCheck.onEnterFrame = function() {
		var percent = (this["_level"+level].getBytesLoaded()/this["_level"+level].getBytesTotal())*100;
		//trace (percent);
		//trace((this["_level"+level].getBytesLoaded()/this["_level"+level].getBytesTotal())*100);
		if (!isNan(percent)) {
			_root.loader_holder.bar._xscale = percent;
		} else {
		//trace(lev);
			trace("0% loaded");
		}
		if (percent == 100) {
			delete progressCheck.onEnterFrame;
			loader_holder._x = 846.0;
			trace("LEVEL: "+level+"      "+"IS FULLY LOADED");
		}
	};
};
levelLoader("ringB.swf", 9); // tried it with one of my files...
oldnewbie is offline   Reply With Quote
Old 08-11-2003, 05:12 PM   #3
ericflash
Senior Member
 
Join Date: Apr 2001
Posts: 940
Ah nice one I tried everything but the right thing. Thanks
YAAAAAAAA
ericflash is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash MX

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:49 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.