Okay what I am trying to do should be pretty simple… I’ve done it quite a few times before but I’m getting nowhere this time. Here’s my setup.
I have a main swf that simply is used to load other swfs as links are clicked. Now two different swfs are always loaded at the same time. One is a banner that contains the menu which is never unloaded. And the other is the content swf that is changed as the links are clicked.
Here’s the setup: It’s not as optimized as it could be because I’ve been messing it up continuously trying to find the problem.
//SNIPPET: this is in the banner.
if (loading) {
loading = _root.checkLoading();
if (!loading) {
turnOn();
}
}
//SNIPPET:this is in the main swf
function checkLoading() {
var rbool:Boolean = true;
var loaded:Number = content.getBytesLoaded();
var total:Number = content.getBytesTotal();
lbar.lbar._xscale = loaded/total*100;
lbar.perc = loaded;
if (total == loaded && total > 1) {
rbool = false;
}
return rbool;
}
//SNIPPET: Last here's the setup for content which is also in the banner
if (_root.chg == "2d") {
loadMovie("2dViewer.swf", _root.content);
} else if (_root.chg == "3d") {
loadMovie("3dViewer.swf", _root.content);
} else if (_root.chg == "web") {
loadMovie("webViewer.swf", _root.content);
} else if (_root.chg == "contact") {
loadMovie("contact.swf", _root.content);
} else if (_root.chg == "about") {
loadMovie("about.swf", _root.content);
} else if (_root.chg == "home") {
loadMovie("main.swf", _root.content);
}
Okay now here’s my problem. content.getBytesLoaded() returns the same as content.getBytesTotal(). And no it’s not 0… it’s a large amount of bytes that I am assuming is the actual Total. And it’s not loaded yet either, one of the swfs is about 2.5 megs and says it is loaded but it’s not even close…
Am I doing something stupid? Probably… if you can help me that would be awesome! In the mean time… I’ll scratch my brain some more…