Thanks matt for pointing out what I should have gotten.  Sometimes I just need to slow down a little bit.  Keeping up with all the emails can be a little hard, and for some reason my search didn’t find it or if it did the title of silly question didn’t help much.  Oh well, thanks for pointing that out.

 

Jeff

 

 


From: Matt Chotin [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 26, 2005 12:55 PM
To: [email protected]
Subject: RE: [flexcoders] Classref for a classname stored in a string

 

I think Gordon along with others answered this yesterday.  mx.utils.ClassUtil.findClass() can do it for you.  You must make sure the class also got itself linked in.  If somewhere else you have a typed reference to the class you should be OK, otherwise you should declare a dummy variable of the class type somewhere in your Application that you are sure is being created.

 

Matt

 


From: Jeff Krueger [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 26, 2005 8:32 AM
To: [email protected]
Subject: [flexcoders] Classref for a classname stored in a string

 

All,

 

            I am trying to get a classRef from a string variable that contains a class name.  I am trying to use this in the function createSegment in the accordion control.  The function requires you to pass a class name like mx.containers.Canvas.  You can’t pass in a string.  In my instance I have that value stored in a string variable.  In java is would be something like Class.forName(“mx.containers.Canvas”).getInstance().  How do you do the same thing in actionScript.  I think it has to do with Object.RegisterClass() but I haven’t been able to figure that out.  I have also looked at UIObject.createClassObject, I have tried to cast the value.  So any ideas or help would be appreciated.

 

Thanks

 

 

Jeff

 

 




Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to