Classes take up room in the SWF, so we only put in classes we know you
need otherwise your SWF would always be 1MB or more.

 

getDefinitionByName is a roll call.  If you aren't in the room, you
won't answer.

 

A fully dynamic system would have to fetch a module that has the class
in it, sort of like a JAR file.  The XML would have the name of the
module or you'd look it up in some other database.

 

I kinda wanted to see video of your computer hitting a taxi cab.

 

-Alex

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of djhatrick
Sent: Wednesday, July 30, 2008 1:32 PM
To: [email protected]
Subject: [flexcoders] Re: Flex woes, wo-iz-o, i hate it (sometimes)

 

Alex,

Say for instance, you want to create this instance, from a class name
defined in XML, and make it "totally dynamic", using this work-around
does not solve that problem. 

This function should really be improved, or, at least the
documentation should really be supplemented to explain more in detail
why this works for the flash namespace, and not the flex name space (
or my own classes)

Thanks for your time and quick response.

Patrick

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Some way you have to create a dependency on VBox to actually get it
> linked into the SWF, otherwise it isn't there to be found. One way is
> to use the shared RSL, but otherwise, you have to actually use the
class
> somewhere. In import statement doesn't actually create a link
> dependency, it simply says what the fully qualified name is when you
> just use VBox.
> 
> 
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of djhatrick
> Sent: Wednesday, July 30, 2008 1:17 PM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Flex woes, wo-iz-o, i hate it (sometimes)
> 
> 
> 
> I am having one of those days where i want to throw this computer off
> the 30th floor of midtown Manhattan onto a taxi-cab's hood, and leave
> for the day never come back.
> 
> This is the problem, I can't get, "getDefinitionByName" to work right,
> what a load of horse pucky... Sorry for being so salty, but if you are
> a developer and you have tried to use this function, it must have
> given you the same type of error, if it hasn't it will...
> 
> I've tried classes with variables and public classes and the whole
> nine-yards, it always gives me this stupid error. 
> 
> Any suggestions, that don't require me to lose life or limb?
> 
> Thanks,
> Patrick
> 
> import mx.containers.VBox;
> import flash.utils.getDefinitionByName;
> private function init():void
> {
> var ClassReference:Class =
> getDefinitionByName("mx.containers.VBox") as Class; // throws error
> 
> //var ClassReference:Class =
> getDefinitionByName("flash.display.Sprite") as Class; // works
> var instance:Object = new ClassReference();
> 
> // addChild(DisplayObject(instance));
> }
> 
> ReferenceError: Error #1065: Variable VBox is not defined.
> at global/flash.utils::getDefinitionByName()
> at TotalBullshitIHavetodoThisTest/init()
>

 

Reply via email to