what i need to do is call a set of functions several times in sequence with different parameters each time. here’s what i’ve got
/////photoload code////
this.fadeSpeed = 10;
this.fadeSpeed2 = 10;
var picToLoad = "";
var whereToLoad = "";
MovieClip.prototype.changePhoto = function(ddd,whatwhat) {
this.picToLoad = ddd;
this.whereToLoad = whatwhat;
trace("this.picToLoad = ddd **** "+this.picToLoad+" + "+ddd);
trace("this.whereToLoad = whatwhat ***** "+this.whereToLoad+" + "+whatwhat);
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.whereToLoad._alpha>this.fadeSpeed) {
this.whereToLoad._alpha -= this.fadeSpeed;
} else {
this.loadPhoto2();
}
};
MovieClip.prototype.fadeOut2 = function(xox) {
trace("fadeOut2 function called");
this.whichToFade = xox;
if (this.whichToFade._alpha>this.fadeSpeed2) {
this.whichToFade._alpha -= this.fadeSpeed2;
}
};
MovieClip.prototype.fadeOut3 = function() {
trace("this.whichToFade = "+this.whichToFade);
if (this.whichToFade._alpha>this.fadeSpeed) {
this.whichToFade._alpha -= this.fadeSpeed;
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.sectImg;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
//this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadPhoto2 = function() {
// specify the movieclip to load images into
var p = this.whereToLoad;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.picToLoad);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.whereToLoad.getBytesLoaded();
t = this.whereToLoad.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.whereToLoad._alpha<100-this.fadeSpeed) {
this.whereToLoad._alpha += this.fadeSpeed;
} else {
this.whereToLoad._alpha = 100;
this.onEnterFrame = null;
}
}
and then i’ve written the following to run the above functions:
MovieClip.prototype.controlPhoto = function(props) {
var ddd;
var whatwhat;
trace("arguments.length = " + arguments.length);
trace("props = "+props);
trace("arguments = "+arguments);
for (var cpi = 0; cpi<arguments.length; cpi++) {
trace("------ "+ cpi + " ------");
trace("arguments[cpi] = "+arguments[cpi]);
var my_array:Array = arguments[cpi];
my_array.slice();
trace(my_array[0]+" *** "+my_array[1]);
ddd=my_array[0];
whatwhat=my_array[1];
this.changePhoto(ddd,whatwhat);
}
}
and i’m calling this function like this:
curr_item.onRelease = function() {
_root.controlPhoto([this.img1,sectImg],[this.img2,leadImg]);
}
but what happens is only the last set of parameters actually get loaded. everything else seems to be skipped over. any help is appreciated!
thanks,
david