-
[as2] variable for a class name?
I'm trying to make an instance of a class based on a variable name, like so:
var cn:String = 'Foo';
var c = new cn(); // i didn't think this would work...
Where c would create an instance of class Foo. I've also tried:
var c = new eval(cn)();
or
var c = new eval('cn')();
and then:
var cn:String = 'Foo()';
var c = new eval(cn);
I've done this in php, but can't seem to get this to fly in actionscript...
Any ideas? Thanks in advance!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|