atslopes
11-24-2003, 02:56 PM
heres the site: http://www.rit.edu/~ast7707/portfolio.html
it works fine but how can i have simple preloader that loads the external swfs
on the first frame of the movie i have**********************
// set up variables for movie start
_root.swfAlert = "fadeout";
_root.swfNum = 1;
_root.swfNumMax = 4;
_root.containerPositionX = 162;
_root.containerPositionY = 79;
_root.fadeSpeed = 8;
// here is the function that loads the movie
// set swfNumMax to the number of movies you will want to import
// make sure you number your external movies "swf1", "swf2", "swf3", etc...
function loadSwf() {
// _root.swfNum++;
// if (_root.swfNum>_root.swfNumMax) {
// _root.swfNum = 1;
// }
// sets the current movie name to load
_root.activeSwf = "swf"+_root.swfNum+".swf";
// load the swf
loadMovie(_root.activeSwf, _root.container);
// set the x, y position
_root.container._x = _root.containerPositionX;
_root.container._y = _root.containerPositionY;
}
// load the first swf when the movie starts
loadSwf();
and on the container i have ***************************
//this enterframe script checks the value of "swfAlert" and does something depending on the returned result
onClipEvent (enterFrame) {
if (_root.swfAlert == "fadeOut") {
_root.container._alpha -= _root.fadeSpeed;
if (_root.container._alpha<=0) {
unloadMovie(_root.container);
_root.swfAlert = "load";
}
}
if (_root.swfAlert == "load") {
_root.loadSwf();
_root.swfAlert = "fadeIn";
}
if (_root.swfAlert == "fadeIn") {
_root.container._alpha += _root.fadeSpeed;
if (_root.container._alpha>=100) {
_root.swfAlert = "static";
}
}
}:o
it works fine but how can i have simple preloader that loads the external swfs
on the first frame of the movie i have**********************
// set up variables for movie start
_root.swfAlert = "fadeout";
_root.swfNum = 1;
_root.swfNumMax = 4;
_root.containerPositionX = 162;
_root.containerPositionY = 79;
_root.fadeSpeed = 8;
// here is the function that loads the movie
// set swfNumMax to the number of movies you will want to import
// make sure you number your external movies "swf1", "swf2", "swf3", etc...
function loadSwf() {
// _root.swfNum++;
// if (_root.swfNum>_root.swfNumMax) {
// _root.swfNum = 1;
// }
// sets the current movie name to load
_root.activeSwf = "swf"+_root.swfNum+".swf";
// load the swf
loadMovie(_root.activeSwf, _root.container);
// set the x, y position
_root.container._x = _root.containerPositionX;
_root.container._y = _root.containerPositionY;
}
// load the first swf when the movie starts
loadSwf();
and on the container i have ***************************
//this enterframe script checks the value of "swfAlert" and does something depending on the returned result
onClipEvent (enterFrame) {
if (_root.swfAlert == "fadeOut") {
_root.container._alpha -= _root.fadeSpeed;
if (_root.container._alpha<=0) {
unloadMovie(_root.container);
_root.swfAlert = "load";
}
}
if (_root.swfAlert == "load") {
_root.loadSwf();
_root.swfAlert = "fadeIn";
}
if (_root.swfAlert == "fadeIn") {
_root.container._alpha += _root.fadeSpeed;
if (_root.container._alpha>=100) {
_root.swfAlert = "static";
}
}
}:o