Hi Everyone, I’m trying to make a random jpeg gallery with images that fade in, remain on screen for 10 seconds, and then fade out. So I’m starting with the fadeIn and I am making it a movieclip prototype. Now, I put a MC named ball_mc on the stage and gave it an alpha value of 0 to use for testing purposes. The ball_mc clip calls the prototype fadeIn fine, but the dynamically created movieclip does not. Is it impossible for a dynamically generated movieclip to use a prototype? I’ll post the code below.
Any and all help is appreciated. I’m on a tight deadline!
Code:
MovieClip.prototype.fadeIn = function () {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 5;
} else {
delete this.onEnterFrame;
}
};
};
_root.createEmptyMovieClip(“container_mc”, 1000);
_root.container_mc._x = 0;
_root.container_mc._y = 0;
loadNewImage = function () {
var r = (Math.floor(Math.random()*7)+1).toString();
container_mc._alpha = 0;
container_mc.loadMovie(“pic”+r+".jpg");
container_mc.fadeIn();
}
setInterval(loadNewImage, 5000);
ball_mc.fadeIn();
stop();