You can either put all shared classes in the main app and not use a
sharedcode modules, or put the classes in a shared code module and not
in the application, then you load it before the modules dependent on it.
The idea is to only load a class once.  If you put all shared classes in
the main app, the main app gets bigger and can take longer to download
and init, but if you go shared code modules it takes longer to load the
actual module since you have to wait for the shared code module first.

 

You will write your modules normally, dropping in any controls you want.
Then you will extern them so the classes don't actually go in the module
swf, and put it in the shared code swf or main app so it gets in there
once and is shared through all modules.

 

Good luck,

-Alex

 

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of shawn.gibson
Sent: Friday, July 13, 2007 5:18 PM
To: [email protected]
Subject: [flexcomponents] Re: "Property leftCan not found on Main and
there is no default value"

 

I'm going through your presentation now, it's a bit of a challenge for
me, but I'll make it work. To start, I'm willing to completely rebuild
my app based on your recommendations in the link. It seems to me the
(initial) critical part is this:

public class SharedCode extends ModuleBase
{
private var dragManager:DragManager;
private var popUpManager:PopUpManager;
}

This is where I initialize all of the variables I want available in
many/all modules, and the same goes for functions, correct? And the
way I use this is to put that both in the main app and all the modules
that will need it?

Also, if I see Flex has auto-imported a class when I drag/drop say a
standard Tree Component (just off the top of my head) into an
app/module, it would also be a case like that where I add it in the
SharedCode class...and then DO NOT add it anywhere else, but import
merely the class SharedCode into each module (and of course the main
app) that will need access to the code inside it? The reasoning being:
the module will assume the main app has loaded the information it
needs to understand the Tree code, in this case.

I hope that's at least a good start...and at least somewhat correct.

Shawn

 

Reply via email to