You could also look into the –includes compiler directive.

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of gustavo.saume
Sent: Wednesday, October 11, 2006 5:11 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: getDefinitionByName(): Variable ... is not defined.

 

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.
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to