Hi everybody,

i got a working function which fires a method on all objects (classes)
with given parameters.

Simplified i'm using the following code

myClass = new Class(
{
      coolFunction: function (arg)
      {
           alert(arg);
      }
});

myArr[0] = new myClass();
myArr[1] = new myClass();

function fireArrayObjectsFunctions(funcName,myArgs)
{
    for (var i=0; i<myArr.length;i++)
    {
       var callString = "myArr["+i+"]."+funcName+"("+myArgs+")";
       eval(callString);
   }
}

fireArrayObjectsFunctions('coolFunction','"Hello World"');

This sort of works but i want to get rid of the evalfunction an the
stringhandling.
Anybody got an Idea how to solve this wis $F or other
prototypefunction?

Thanks
Joker

P.S.
Please excuse my lack of proper english.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to