ok I have a movie that I need to load but only if it hasn’t already been loaded and I’m sure you can use an if statment, i’m just not sure how the syntax go’s
I’m kinda really bad at that stuff
ok I have a movie that I need to load but only if it hasn’t already been loaded and I’m sure you can use an if statment, i’m just not sure how the syntax go’s
I’m kinda really bad at that stuff
Allright well… Just do something like…
As soona s the movie is loaded the first time… Set up a flag variable.
movieLoaded = TRUE;
Then just make sure to test if the movie was loaded or not yet by testing if the movieLoaded variable is TRUE or FALSE;
if(movieLoaded == FALSE)
{
---- Load Movie
}
Good luck and hope this helps you out some.
ya that did work but there is another problem, I need to be able to load other movies in to the same spot. The movie I need to not change on some button clicks, needs to change on other button clicks.
I see… Well man… Just make it like this…
if there is a movie currently loaded up… Then first unload the movie and then load up the new movie. You can also make another flag variable then…
currentMovie = 1;
openMovie = 2;
Then set it up where if the button is pressed… After it unloads the movie already there… it’ll change the currentMovie number to a unique id… Also…Have another variable that tells the movie to check which mvoei is being loaded up.Then it’s as simple as saying…
[AS]
for(x=0; x<2; x++)
{
if(movieLoaded == FALSE)
{
//load movie here
movieLoaded = TRUE;
currentMovie = openMovie;
} else {
if(currentMovie != openMovie)
{
//unload current movie
movieLoaded = FALSE;
}
}
}
[/AS]
Now… In every button you will want openMovie to change to a unique id number… And if that number is different from the number stored (or the current movie opened… Then you will be made
ok could you explain where all that code should go,
Say
on load up of the main movie leftinfo.swf is loaded in to emptyMC, when I press the about us button aboutus.swf is loaded in to emptyMC, then if I click on pictures leftinfo.swf loads back in but if I click on pictures agian it will load leftinfo.swf agian. and thats what I don’t want. If it’s loaded I don’t want it to reload when I press another button that requires leftinfo.swf to be there, it should just stay put.
sorry man, when it come to script i’m dummer then a bag of rocks
Nah man… You’ll get the hang of this stuff… it doesn’t just pop in your head
[AS]
_root.onLoad = function()
{
currentMovie = 1;
movieName = “leftinfo.swf”;
}
_root.onEnterFrame = function()
{
for(x=0; x<2; x++)
{
if(movieLoaded == FALSE)
{
emptyMC.loadMovie(movieName);
movieLoaded = TRUE;
currentMovie = openMovie;
} else {
if(currentMovie != openMovie)
{
emptyMC.unloadMovie();
movieLoaded = FALSE;
}
}
}
}
[/AS]
Place the code above in the frame where everything is happening. Or where everything is looping around… Then… For all your buttons… Have something like this.
[AS]
on (press)
{
_root.openMovie = 1;
_root.movieName = “leftinfo.swf”;
}
[/AS]
Each button should look like that except for the movieName and openMovie properties… Each button should have a different number as the openMovie property and each one should have a new movieName as well
Hope this works out for you… Ask me more questions if you need any more help.
:: Copyright KIRUPA 2024 //--