Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lynda.com - Flash Tutorial Preloader - :( mine is not workind

Status
Not open for further replies.

jbezzina

MIS
May 4, 2004
46
MT
I have followed the preloader lesson in this fab tutorial but my totalBytes value is not piking up any data. I cannot understand why this is happening. I am (99.99%) sure that the code is correct.

If you are not familiar with this tutoral it basically preloads a MC in level 50, and on loading any other MC the the preloader animation moves through the 100 frames (1 frame per 1%)

The loadedBytes is working btw.

Please help !!
__________________________________________
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes/totalBytes)*100);
_level50.preloader.gotoAndStop(preloadPercent);
_level50.preloadInfo1.text = preloadPercent+" % Loaded";
_level150.preloadInfo2.text = Math.round(loadedBytes/1000)+" K Loaded / "+Math.round(totalBytes/1000)+" K Total";
};
myListener.onLoadComplete = function(target_mc) {
_level50._visible = false;
};
__________________________________________
 
I solved the problem. I was testing via an FTP location and this failed to get the preloader kicking. Once I uploaded to my site and viewed via HTTP it worked.

Thanks for all the answers ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top