Hi group

I tried to store a list of "Class" and fetch those class definition to
create new instance in the following way:

myclasses = {
  A: Class.create({...}),
  B: Class.create({...}
  ...
};
...
for (var i = 0; i < myclasses.length; ++i) {
  var cls = myclasses[i];
  var obj = new cls(...);
}

Unfortunately the above code failed at "var obj = new cls(...);" and it
throws out the exception: "string is not a function". Do you have any idea?

Thx,
Green

-- 
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-scriptacul...@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