Thanks, Matt. 
Now I got it, but
// we can't
// reference the WatcherSetupUtil class in the component, because the
// WatcherSetupUtil can't be generated until after the component 
class is
// done compiling.

Can you ask Paul why he didn't use reflections to reference 
WatcherSetupUtil??? It looks much more reliable then generated code 
approach.

- Max

--- In [email protected], "Matt Chotin" <[EMAIL PROTECTED]> wrote:
>
> From Paul (who wrote the binding support in 2.0)
> 
>  
> 
> For now, analzying the catalog.xml files seems like it will work 
fine.
> 
> Alternatively, he could compile an application with the components 
in it
> and then look for the WatcherSetupUtil's in the generated 
SystemManager
> class.  Either way, once the list is discovered, manually 
initializing
> the WatcherSetupUtil classes after calling
> 
> ApplicationDomain.getDefinition() seems like the only option to 
simulate
> what a generated SystemManager would do for a component used in the 
top
> level SWF.
> 
>  
> 
> As far as why these classes are initialized in the generated
> SystemManager, we do this because we need them to be initialized 
pretty
> much at the same time the component class is initialized, but we 
can't
> reference the WatcherSetupUtil class in the component, because the
> WatcherSetupUtil can't be generated until after the component class 
is
> done compiling.  This is the replacement for the two pass 
compilation in
> Flex 1.X.  The frameEndHandler is not important.  It's just where 
the
> SystemManager happens to do it's thing and it was an easy place to
> insert the WatcherSetupUtil initialization.
> 
>  
> 
>  
> 
> ________________________________
> 
> From: [email protected] 
[mailto:[EMAIL PROTECTED] On
> Behalf Of maxym.hryniv
> Sent: Friday, September 08, 2006 12:29 AM
> To: [email protected]
> Subject: [flexcoders] Re: Fw: WatcherSetupUtil issue
> 
>  
> 
> Thank you for reply.
> I described allready that I create flex-library (.swc) for every 
> component and I get needed classes using 
> ApplicationDomain.getDefinition(). So SystemManager doesn't know 
> about these classes and doesn't initialize binding for them.
> 
> I had conversation with Manish Jethani and we found the solution - 
I 
> can analyze catalog.xml for every swc, find all *WatcherSetupUtils 
> and initialize them when I'm loading the library.
> 
> But can you give me the reason why binding initialization is 
> performed in the frameEndHandler? It's hard dependency of 
components 
> to generated code and my issue it's the one of many possible bugs 
> that such dependency can involve. It's a kind of logic that has to 
be 
> executed before first load of the component (in static constructor 
> emulation).
> 
> --- In [email protected] 
<mailto:flexcoders%40yahoogroups.com>
> , "Matt Chotin" <mchotin@> wrote:
> >
> > It'd be for any MXML class that has binding in it. So there must 
be
> > errors with how binding is initializing based on how your system 
is 
> set
> > up. Are you using the techniques for modules that Roger mentioned 
> in
> > his blog postings?
> > 
> > 
> > 
> > Matt
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected] 
<mailto:flexcoders%40yahoogroups.com>
> 
> [mailto:[email protected] 
<mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of maxym.hryniv
> > Sent: Wednesday, September 06, 2006 11:49 PM
> > To: [email protected] 
<mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: Fw: WatcherSetupUtil issue
> > 
> > 
> > 
> > Hey!!.... Flex framework developers. Can you give some 
information 
> > about *WatcherSetupUtil.as? I really want for what it's generated?
> > 
> > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>  
> <mailto:flexcoders%40yahoogroups.com>
> > , "maxym.hryniv" <mokus@> wrote:
> > >
> > > Any ideas???
> > > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com> , "maxym.hryniv" <mokus@> 
> wrote:
> > > >
> > > > Hi, coders.
> > > > I'm trying to create multimodule (multi swf) application. I'm 
> > using 
> > > > next approach: I create flex library for every component. In 
> > > runtime 
> > > > main application loads needed library then gets needed 
> component 
> > > > definition using ApplicationDomain.getDefinition(). 
> > > > I have next issue: some of components are not properly 
> > initialized 
> > > > and null pointer exception is thrown. For each of these 
> > components 
> > > > flex generates _{packageName}_{className}WatcherSetupUtil.as 
> > class. 
> > > > Other components work fine.
> > > > I found some logic in SystemManager that can correct this:
> > > > // trace("initializing mixin " + mixinList[i]);
> > > > var c:Class = Class(getDefinitionByName(mixinList[i]));
> > > > c["init"](this);
> > > > If I add such logic for every class that has 
> *WatcherSetupUtil.as 
> > > > generated, everything works fine.
> > > > 
> > > > Of course I can try to initialize *WatcherSetupUtil for every 
> > class 
> > > > that I get from external ApplicationDomain, but if component 
> has 
> > > > child component with *WatcherSetupUtil it will not work. 
> Because 
> > I 
> > > > cannot proxy child creation in mxml component.
> > > > 
> > > > So the question is: "How i can determine classes with 
> > > > *WatcherSetupUtil.as generated in runtime?", and "What the 
*** 
> is 
> > > > WatcherSetupUtil? I cannot find any reference in help, 
> livedocs, 
> > > > flexcoders, google.".
> > > > Thanx in advance for any help, ideas.
> > > >
> > >
> >
>






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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to