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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

yet another loadMovie problem; grrr...

Status
Not open for further replies.

adamr1001

MIS
Jul 25, 2001
166
CA

alright.
i'm getting fine results when i run this from my computer, but not when its uploaded online. ...there are no path errors (i.e. filenames), so i assume its a loading issue.

i have a menu in a main flash file, and when options are selected, its calls to load the respective swf, and then unloads what was previously in the holder.

here is an example of the code for the button 'about us',
where _global.current checks to see if the content is already loaded; each option renames this variable respectively.

on (release) {
if (_global.current != "aboutus") {
unloadMovie(_root.mainHolder);
loadMovie("aboutus.swf", _root.mainHolder);
_global.current = "aboutus";
}
}

i put a preloader in each swf file to be loaded, where frame 10 has the content to be displayed:

loaded1 = _root.getBytesLoaded();
loadedtext = loaded1/_root.getBytesTotal()*100+"%";
if (loaded1 == _root.getBytesTotal()) {
gotoAndStop(10);
} else {
prevFrame();
play();
}

the probelm is that the preloaded flashes for a moment, but then nothing shows. if click on another button and then back the first one - this time it'll show. lol... i have no idea whats going on.

help!

(thanks a million in advance)

-adam
 
i'd try this in the debugger, and set a breakpoint at that final if/then. here's my attempt to guess what's wrong, though.:)

when you run it on your own computer, loaded1 is probably equal to getBytesTotal() by the time that boolean is checked.. so it probably goes to 10. so i'm assuming it's something in the else block.. which would also explain why it would work the second time (because by that time, enough has loaded by the time you run that boolean again).

now prevFrame() will move the printhead from where it is at that moment to one back from there, and then stop... now i THINK that means if it's not done loading, the printhead is not necessarily on the same frame that the code is being run in. (at least i had an experience that led me to believe that, although i could very well be wrong.) so you'll really want to run the debugger and find out where it's going during all of this. also, you could try hard coding a frame number instead of prevFrame() to see if/how that changes things.

best of luck, hopefully that'll be a start. Liam Morley
lmorley@gdc.wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top