Thanks, forgot about eval.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ralf Bokelberg
Sent: 11 December 2005 21:03
To: Open Source Flash Mailing List
Subject: Re: [osflash] Getting an Object reference from a String

var theConstructor = eval(theString);
var theInstance = new theConstructor();

Cheers,
r.

jim wrote:

> Hey guys,
> 
> Bit off topic but does anyone know if you can get an object reference
> from a string? So if I pass into my function the string
> "org.somwhere.SomeClass" can I convert that to a reference to the
class
> org.somwhere.SomeClass?
> 
> I need to do this as I am passing in a reference from an XML file to
> stop me having to recompile every time I change something.
> 
> Jim
> 
> 
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org


_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to