Hello Tobias, i recently had the same problem, the workarround i usesd was to create a class with a variable declaration of all the classes i might create....
eg. public class AllClasses { public var tmp1:classOne; public var tmp2:classTwo; } and then in my class where i call getDefinitionByName i created another varible of this type (eg. public var tmp:AllClasses)...you dont need to instanciate it... it´s almost the same but at least is a bit organized... if anyone have a more elegant solution please notify... Gus. --- In flexcoders@yahoogroups.com, "tobiaspatton" <[EMAIL PROTECTED]> wrote: > > Hello List; > > I'm trying to create an interface where a user's selection in a menu > component results in other components being created. Right now I'm > just prototyping, and experimenting with different ways I might do > this. > > One way I've thought of is to use an XML data provider for the list > where an attribute of each menu entry describes a class that should > be instantiated when that item is selected. > > e.g. > > <menu item label="classOne" > childClass="com.Kodak.Galiano.Test.classOne"/> > > I'm running into a problem, though. Because "classOne" is never > actually used in the source code, "classOne" is not being compiled > and linked into the application. When I call getDefinitionByName > ( "com.Kodak.Galiano.Test.classOne" ), there is an error: Variable > classOne is not defined. > > Is there some trick I can use to force classOne to be compiled and > linked into the application? Right now my solution is to add a > private function that defines a local variable of the appropriate > type. > > private function TrickCompiler() : void > { > var x : classOne; > } > > This does the trick, but it sure seems hacky. > > Thanks. > Tobias. > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/