I recently did the hover caption tutorial, and it works great. Only thing is, I didn’t like how the caption box was never quite the right width for the caption text. So I decided to create all my captions and try to use an array, and one of the arguments in the function would call the caption using the array. The variable “cap” is assigned to the array variable in the function, which corresponds to the instance name of the caption to use. It traces right, but it won’t grab the caption. The code works fine if I substitute the “cap” variable for the instance name of the caption. I’ve tried moving the variable around but it still won’t work. Here is the code.
function call: (used in onRollover)
captionFunc(true, 0);
function: (“capChoice” is the array function).
function captionFunc (showCap, whichCap) {
if (showCap) {
this.createEmptyMovieClip(“hoverCaption”, this.getNextHighestDepth());
cap = capChoice(whichCap);
trace(cap);
hoverCaption.onEnterFrame = function() {
cap._x = _root._xmouse+xo;
cap._y = _root._ymouse+yo;
cap._visible = true;
};
} else {
delete hoverCaption.onEnterFrame;
cap._visible = false;
}
};
Thank you for your help!