OK, I’ve been going at this for over a week now and I just can’t figure it out.
I’m using setInterval to fade in all MovieClips. All my pages are loaded from external movieclips into level 2. When I click a link to load an external page, it’ll pop up and disappear. What is causing this to happen? Am I doing something wrong with this code? :-/
“index.swf, level_0”
loadMovieNum("home.swf", 2);
setInterval(fadeInFunction, 800);
counter = 0;
function fadeInFunction() {
counter++;
_root.Increment(counter, 100, 2);
}
function Increment(count, maxAlpha, speed) {
_root.onEnterFrame = function() {
_root["MovieClip_mc"+count]._alpha += speed;
if (_root["MovieClip_mc"+count]._alpha>=maxAlpha) {
_root["MovieClip_mc"+count]._alpha = maxAlpha;
delete _root.onEnterFrame;
}
};
}
var colorful = new Color(_root.MovieClip_mc3);
MovieClip_mc3.onRollOver = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc3) {
_alpha = 50;
Increment(100,4);
}
};
MovieClip_mc3.onRollOut = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc3) {
_alpha = 100;
Increment(50, 4);
}
};
MovieClip_mc3.onRelease = function() {
loadMovieNum("home.swf",2);
}
var colorful = new Color(_root.MovieClip_mc4);
MovieClip_mc4.onRollOver = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc4) {
_alpha = 50;
Increment(100,4);
}
};
MovieClip_mc4.onRollOut = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc4) {
_alpha = 100;
Increment(50, 4);
}
};
MovieClip_mc4.onRelease = function() {
loadMovieNum("booking.swf",2);
}
var colorful = new Color(_root.MovieClip_mc5);
MovieClip_mc5.onRollOver = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc5) {
_alpha = 50;
Increment(100,4);
}
};
MovieClip_mc5.onRollOut = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc5) {
_alpha = 100;
Increment(50, 4);
}
};
MovieClip_mc5.onRelease = function() {
loadMovieNum("venue.swf",2);
}
var colorful = new Color(_root.MovieClip_mc6);
MovieClip_mc6.onRollOver = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc6) {
_alpha = 50;
Increment(100,4);
}
};
MovieClip_mc6.onRollOut = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc6) {
_alpha = 100;
Increment(50, 4);
}
};
MovieClip_mc6.onRelease = function() {
loadMovieNum("bio.swf",2);
}
var colorful = new Color(_root.MovieClip_mc7);
MovieClip_mc7.onRollOver = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc7) {
_alpha = 50;
Increment(100,4);
}
};
MovieClip_mc7.onRollOut = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc7) {
_alpha = 100;
Increment(50, 4);
}
};
MovieClip_mc7.onRelease = function() {
loadMovieNum("photo.swf",2);
}
var colorful = new Color(_root.MovieClip_mc8);
MovieClip_mc8.onRollOver = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc8) {
_alpha = 50;
Increment(100,4);
}
};
MovieClip_mc8.onRollOut = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc8) {
_alpha = 100;
Increment(50, 4);
}
};
MovieClip_mc8.onRelease = function() {
loadMovieNum("video.swf",2);
}
var colorful = new Color(_root.MovieClip_mc9);
MovieClip_mc9.onRollOver = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc9) {
_alpha = 50;
Increment(100,4);
}
};
MovieClip_mc9.onRollOut = function() {
MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (MovieClip_mc9) {
_alpha = 100;
Increment(50, 4);
}
};
MovieClip_mc9.onRelease = function() {
loadMovieNum("contact.swf",2);
}
“home.swf, level_2” code:
stop();
setInterval(fadeInFunction, 800);
counter = 0;
function fadeInFunction() {
counter++;
_root.Increment(counter, 100, 2);
}
function Increment(count, maxAlpha, speed) {
_root.onEnterFrame = function() {
_root["MovieClip_mc"+count]._alpha += speed;
if (_root["MovieClip_mc"+count]._alpha>=maxAlpha) {
_root["MovieClip_mc"+count]._alpha = maxAlpha;
delete _root.onEnterFrame;
}
};
}
Is there something I can fix or should I try an alternate method?