I would like to change this:
into something like this:Code:obj = new _objectClass();
Actually this last piece of code throws the following error:Code:var objClass:Class = _objectClassArray[range(0, _objectClassArray.length)] as Class; obj = new objClass(); trace (_objectClassArray[range(0, _objectClassArray.length)]) // returns [class MyClip] or [class MyClip2] and so on..
TypeError: Error #1007: Instantiation attempted on a non-constructor.
Full explanation:
This code goes inside an ObjectPool from HYPE Framework of Joshua Davis.
I´ve created a "MultipleObjectPool" and changed some little details , that is: the constructor, instead of receiving a Class as a parameter, receives then a Class Array, so each time it should create an object (via the request() function) of a Class that is picked randomically from the Class Array.
Is that possible ?
Thanks in advance!




Reply With Quote
