> Are you going to compile a page when a request comes in?
That's the impression I got of what Sébastien wants to do.
> all custom components needed to be referenced once inside my code
If you're creating components via their class name, with code like
var someClass:Class = Class(getDefinitionByName(someClassName));
var instanceOfSomeClass:Object = new someClass();
there is no way that the MXML compiler/linker can be smart enough to figure out
what class names might be encountered at runtime. Therefore it can't include
these classes in the SWF unless you give it some help.
One way is to use vars like you show to create dependencies.
Another way is to use the -include-classes compilation option. For some reason
that I don't understand, this is only an option for compc when you make a SWC,
not for mxml when you make a SWF. But you can make a SWC with all your custom
classes and then link that SWC in with -include-libraries.
Another possibility is to put all your custom classes into a module and load it.
Gordon Smith
Adobe Flex SDK Team
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
DreamCode
Sent: Sunday, December 02, 2007 2:38 PM
To: [email protected]
Subject: Re: [flexcoders] Runtime MXML compiler
Hey Sebastien/Gordon
I'm not sure I understand what you're asking... mxml compilation at runtime?
Are you going to compile a page when a request comes in?
As for the dynamic creation of content based on custom xml, that is quite nice.
It's a big part of my current "spare time" project.
The only real issue so far I have had, is that in order for me to generate the
UI, all custom components needed to be referenced once inside my code. So even
though I have this:
import dc.digr.ui.comp.*;
I still need this:
var a:digrButton = new digrButton ();
var b:digrButtonLarge = new digrButtonLarge();
var c:digrButtonIconOnly = new digrButtonIconOnly();
var d:digrButtonMini = new digrButtonMini();
for all the custom ui components in the beginning of my code to avoid a runtime
error....
Gordon, if you have some wisdom on this.... Spread the joy! J