Hi,
Ive been searching here and Flashkit for an answer, and I’m not having much luck. I thought I had it mastered, but i was wrong :(. Could someone please explain to me how I can use the eval() or ‘[]’ properly to make a dynamically generated function call ?
Below is a “small scale” example of what Im trying to achieve.
MovieClip.prototype.formatShape = function(){
trace("formatShape called!!!");
with(box_mc){
setRGB(arguments[0]);
_width=arguments[1];
_height=arguments[2];
}
};
myShapes=new Array();
myShapes[0] = {mc:box_mc, action:{func:"formatShape", args:[0xFF0000, 200, 100]}};
myShapes[0][mc].myShapes[0][action[func]](myShapes[0][action[args]]);
stop();
Essentially, the scenario in this case is there are a series of shapes on the stage. And each shape can call a set function and pass a number of parameters for the relevat formatting required. Although in this case there is only one formatting function called ‘formatShape’.
Thanks in advance