Hi. I keep experiencing the error message “256 levels of recursion” in my flash movie. Can someone have a look at the code I’m using and identify what is causing this? Forgive me for posting lots of code, but there are three possible culprits. I’ll post them seperately in different threads. Thanks…
// Actions for buttons
btn1_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical1.jpg”);
};
btn2_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical2.jpg”);
};
btn3_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical3.jpg”);
};
btn4_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical4.jpg”);
};
btn5_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical6.jpg”);
};
btn6_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical7.jpg”);
};
btn7_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical8.jpg”);
};
btn8_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical9.jpg”);
};
btn9_btn.onRelease = function() {
loadThenGrow(“kuz images/kuzpical11.jpg”);
};
function loadThenGrow(img) {
bg_square_mc._parent.holder_mc.removeMovieClip();
bg_square_mc._parent.createEmptyMovieClip(“holder_mc”, 1);
bg_square_mc._parent.holder_mc._visible = false;
bg_square_mc._parent.holder_mc.onData = function() {
if (this.getBytesLoaded() == this.getBytesTotal()) {
this._visible = false;
w = this._width;
h = this._height;
bg_square_mc.growTo(w+2, h+2, 10,showHolder);
}
};
bg_square_mc._parent.holder_mc.loadMovie(img);
}
function showHolder() {
w = bg_square_mc._parent.holder_mc._width;
h = bg_square_mc._parent.holder_mc._height;
bg_square_mc._parent.holder_mc._x = bg_square_mc._x-w/2;
bg_square_mc._parent.holder_mc._y = bg_square_mc._y-h/2;
bg_square_mc._parent.holder_mc._visible = true;
bg_square_mc._parent.holder_mc._alpha = 0;
bg_square_mc._parent.holder_mc.fadeTo(5, _root.doneHolder);
}
MovieClip.prototype.fadeTo = function(fadeRate, callback) {
if ((fadeRate == undefined) or (fadeRate<=0)) {
fadeRate = 10;
}
if (!this.fading) {
this.fading = true;
this.fadeInterval = setInterval(this, “doFadeTo”, 60, fadeRate, callback);
}
};
MovieClip.prototype.doFadeTo = function(fadeRate, callback) {
if (this._alpha > 100) {
clearInterval(this.fadeInterval);
this.fading = false;
if (callback) {
callback();
}
} else {
this._alpha += fadeRate;
}
};