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

timing issues-preloader of sorts??? 1

Status
Not open for further replies.

bugg

Programmer
Jun 20, 2001
62
0
0
US
In my main mc, I've got several empty mcs into which I am loading external .swfs, problem is that when they get loaded into the main mc, I need to call a function to prepare them for action (they load with everything visible, and activated) the function I have that loads them into the empty mc looks something like this:

function loadIn (fil, lod) {
loadMovie(fil, lod);
_root.unActivateProject (lod);
}

where _root.unActivateProject (lod) prepares the external .swf.

when _root.loadIn is called, it loads the .swf properly, but I think that the _root.unActivateProject () is coming too quickly after the initial call to load for it to have an effect on the mc as they end up loaded in their "activated" state. A temporary button which calls the unActivateProject function seems to do the trick, but needless to say, I'd prefer it do it on its own. Anybody have any ideas as to a remedy for this? My thought is that it may need a preloader of sorts to determine when it has finished loading and then invoke the unActivateProject function, but I haven't been able to get one to work (I must at this point admit, that the relatively simple beast known as a preloader is something that I have been unable to master, ever...) Anyways, if anybody has any ideas or suggestions, I would really appreciate any input...

tia
bugg

"there is a distinct difference between complex and complicated, but its slight and kinda tricky..."
 
Why not make the "to be loaded" movies simply invisible to start with (with a first blank keyframe and stop action), and then simply activate them when you're sure they're fully loaded?

Regards,

cubalibre2.gif
 
I'm assuming (and that may be dangerous) that you mean to put a looping empty frame in frame one of the "to be loaded movie" which checks to see if it is fully loaded, then, when it is to goto frame two? If that's the case, the problem is that the function called to unactivate the loaded movie resides within the _root of the main movie, can I call a parent function from a child movie? would it be just then calling the _root.unActivateProject (this)? (I'm using relative paths in the child movies to allow for dragging no matter which "loader" it resides in) writing this out, makes me think I may have it, but will have to give this a go, thanks much for the quick response

bugg
 
oldnewbie-

worked like a charm! thankyou veryVeryVeryVeryMuch, you rock!

-bugg
 
What I was actually trying to say, is that, if while they're preloaded, and they're invisible and stopped on their first blank keyframes when they are loaded, the "to be loaded" movies, would in fact be unactive, thus no need to unactivate them upon loading.
Simply monitor their preloading, either from the main movie itself, or from their within preloaders that only signal to the main movie that they're are in fact preloaded, rather than make them play, and when all movies are loaded, then you can have them play from the main movie, thus activating them...

Does this make any sense? I've got to hit the sack! Early start tomorrow!

Regards,

cubalibre2.gif
 
huh, thought I had replied to this the other night... anyways, oldnewbie - yes, I totally see what you are saying, however in this case, there are really three states (as "unactivated" necessitates some visibility) - invisible (while the movie is loading) , unactivated (visible, but with text and images put away), and activated (visible with text and images displayed) your first post got me thinking as I was responding and I gave it a shot as I had written it out there, and it works quite well although I will likely tweak it a little to make it a bit smoother. Thanks again for your help, much appreciated

-bugg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top