You could add a variable into the movie being loaded, in the first frame, ie:
loaded = "true";
Then, in the movie which initiates the load you could check for the existence of this variable in the level you state. For example, if I were doing this, I would have a button with the following actions inmy main movie:
on (release) {
loadMovieNum ("my-movie1.swf", 1);
tellTarget ("_root.variablecheck" {
gotoAndPlay (1);
}
}
This initiates the loading of "my-movie1.swf" into _level1, and at the same time initiates a 'control' movie-clip (instance name: "variablecheck", and residing in the main timeline), which would check for the existence of the variable in the loaded movie. I would have the control mc about say 24 frames long with the following actions in the first frame:
if (_level1:loaded=="true" {
stop ();
} else {
play ();
}
and the 'check' repeated in the last frame (for connection time puropses) with the instruction to goto the error frame if the variable is non-existent:
if (_level1:loaded=="true" {
stop ();
} else {
with (_root) {
gotoAndStop ("errorframe"
}
stop ();
}
...which tells the main-timeline to go to the frame labelled "errorframe" should the variable "loaded" in "my-movie1.swf" not be detected.
davdesign@pinkzeppelin.com
I tried out the code you supplied, I was dead certain it was going to work, though I found that it always passed a "true" condition. I modified it slightly to work with targets rather than levels.
I realised that by not finding a MC there will be no _level1.loaded to check against & that the last _level1.loaded condition is held somewhere! It is very confounding... X-) I spent most of the day modifying the code with additional variables just to try and get something!
I could send you the FLA if you would like to play around with it!
Here is a link to the site online that you could have a look at in the meantime, i have uploaded it in order to test in a live environment. The check problem as discussed above can be found in the "The Pictures" link...
It works great, though I had to add a line to reset the _level0.loaded variable to false for use with multiple files, as the variable was remaining true.
I have modified a few things on the site and here it is in it's current form.
A few niggles though. When I clicked on the gallery pics I selected the underwater section and the gallery which appeared contained "the end" with no way of returning to the previous page and no images at all, is this under development at the minute? I would also stick a preloader in the 'equipment' section as it is 290K. Even on my remote 56K connection it takes a while and I (personally) like to know if something is loading or not, without having to check my connection in dial-up-networking.
Other than the above, everything works great, and expect an e-mail when I get back regarding b+w development! ;-)
Well the problem that I was worried about is there.. It seems that the clip that I load doesn't seem to work? Only on some occasions... It is rather irritating, when I run it within flash testing the "connection speeds" it works out fine... I have gone through the code over and over again, and it all checks out! Also the underwater section in the gallery, uses the identical code as the two other sections... I am very confused !!
I had designed some really nice preloaders!! In fact I like them better than the rest of the flash stuff!!
This is the wierdest setup I have ever done. The "camera.swf" which is the one being loaded in the equipment section, never redraws properly in the preloader? It is very odd. I have had a friend who works at IBM check it out and it works fine, and a friend in Vancouver Canada, also said it worked out fine, this is all very strange.
I just checked again, despite the bad redraws of the preloader, the actual swf file has loaded, if you exit that screen and reenter, it works fine...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.