View Full Version : setInterval problems
darkstyle
11-28-2004, 05:43 AM
Hi there,
I am planning to load four external .swf banner advertisement loaded in a main movie.
But the problem is that I don’t know how, I want the 1st movie to load in main.swf and then play , after its done with it ,it unload the 1st movie from the main.swf and automatically load loads the 2nd movie and so forth. I have some basic idea that I have to do something with setInterval , I guess… please….help.!!
pheral
11-28-2004, 07:43 AM
Do you really want it to only play through once, or maybe just keep looping for a set number of time? I know most of the times I am actually interested in a web ad (RARE) I get kind of mad when it changes on me and I missed out on it. The other reason that I ask is that it might be a different approach for each method...
farafiro
11-28-2004, 01:18 PM
u canl load all of them into a hidden MC's (holder) (i.e _alpha = 0), then in each one's last frame _level0.holder2_mc._alpha = 100
_parent.unloadMovie()
darkstyle
11-29-2004, 08:57 AM
but i dont want to load at once.. after on movie to loaded with showing the loading bar and then when the movie is loaded completely , it plays the movie. after then movie is played completely, it automaticly goes to another movie and loads the movie with loading bar .... it goes on looping..through 4 external movies.
farafiro
11-29-2004, 09:08 AM
u have lost me
can u point to the first movie with A and the other with B,....
emergency_pants
11-29-2004, 10:26 AM
Use movieClip._currentframe and _movieClip._totalframes
frame script:
var currentMovie:Number = 0;
var maxMovies:Number = 4;
var movieLoaded:Boolean = false;
function getMovie() {
//your preload and load stuff here
movieHolder.loadMovie("movie"+currentMovie+".swf");
}
This script attached to a holder for your swf files:
onClipEvent (enterFrame) {
if (this._currentframe == this._totalframes) {
_parent.getMovie();
}
}
onClipEvent (load) {
_parent.currentMovie++;
if (_parent.currentMovie>_parent.maxMovies) {
_parent.currentMovie = 1;
}
}
There may be a better way of doing it without having to attach scripts to the movieHolder, but this'll work.
I've attached a test.
darkstyle
11-30-2004, 08:53 AM
thank u all....! :)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.