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 [EMAIL PROTECTED]ups.com,
"tobiaspatton" <tobias.patton@...>
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.
>