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!

Help with checking a .swf has loaded

Status
Not open for further replies.

Nicoss

Programmer
Sep 23, 2003
4
GB
I have a series of buttons which all load diferent .swf into my main movie when pressed using the code

on (release){
loadMovieNum("****.swf", 1);
}


This works, but if I load an .swf by clicking a button, when I click the button again it reloads the .swf again.

Is there a way to check if the .swf is already loaded or being loaded so when pressed again the button does not reload it?
 
You could try something like this...
Code:
on (release){
    if(_level1.getBytesLoaded > 0){
        stop();
    } else {
        loadMovieNum("****.swf", 1);
    }
}





Regards,

cubalibre2.gif
 
Hi, I have tried puting this code in, but the movie plays exactly how it did before so something must be wrong with the first part of the code.

If it is of any help, my buttons are in a movie clip on the main timeline, and the .swf I am loading in has a pre loader inserted into the start of it. Maybe one of these will make a diference?

Thanks
 
Are you really loading on a level? Or in a container movie clip?

Regards,

cubalibre2.gif
 
ok, maybe I was wrong. The buttons I have are in a movie clip. However, I also have several buttons in that movie clip all loading seperate .swf file, so I also need some way for the program to recognize that;

on (release){
if(_level1.getBytesLoaded > 0){
stop();
} else {
loadMovieNum("****.swf", 1);
}
}

refers to the .swf I am trying to load, otherwise any loaded .swf could prevent a of the buttons from working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top