You can probably use getDefinitionByName() for the same:

var ClassReference:Class = getDefinitionByName("my.custom.ClassName")
as Class;

but one thing that you have to make sure that, the class (that you are
trying to instantiate dynamically) is exported as part of the SWF
file. You can do that by doing something like this:

package example
{
import example.items.*;
import flash.utils.getDefinitionByName;

class Test
{
private var _class1:example.items.Class1;
private var _class2:example.items.Class2;

public function Test()
{
var test:Class = getDefinitionByName(“example.items.Class1″) as Class;

var testInstance = new test();
}
}
}


Regards,
--
Prasanta Saha

Word of mouth is the best marketing tool. Try it!
http://tellafriend.socialtwist.com

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to