CREATION_COMPLETE is passed to each UIComponent before INIT_COMPLETE
tells the preloader to go away.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of maximecowez
Sent: Tuesday, April 15, 2008 5:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Custom preloader bug

 

Yepee! I finally nailed it! Took me three hours.
And I now really think this might be a Flex bug or at least an
inconsistency.

What I did wrong:
I created my main controller (that sets up all event listeners and more)
on INIT_COMPLETE
And now I create it on CREATION_COMPLETE and everything is ok.

Now here's the weird part: CREATION_COMPLETE is dispatched before
INIT_COMPLETE
And anyway one may expect that the Flex framework and everything needed
is completely loaded on init_complete.

That said: my problem is solved. But is this a Flex bug or am I looking
at it the wrong way?

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> There's nothing wrong with using that event, it is what is in your
> preloader that matters. Not sure what you're doing in your preloader,
> but I can't imagine how you can get radiobuttons to show up as
buttons.
> 
> 
&g! t; 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
> Behalf Of maximecowez
> Sent: Monday, April 14, 2008 9:33 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Custom preloader bug
> 
> 
> 
> Well I supposed the FlexEvent.INIT_COMPLETE event got dispatched when
> the framework had finished loading. Is there another event I have to
> listen for then?
> Plus the bug only seems to apply to children of the Button class.
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" aharui@ wrote:
> >
> > The preloader runs while the framework is loading, so you can't have
> any
> > framework dependencies
> >
> >
> >
> > _______________! _________________
> >
> > From: fl! excoders @yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
> ]
> On
> > Behalf Of maximecowez
> > Sent: Monday, April 14, 2008 3:29 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

> > Subject: [flexcoders] Custom preloader bug
> >
> >
> >
> > I wonder if this is a Flex bug or if I'm doing something wrong: I'm
> > using a custom preloader to first fetch all the data and only then
> > display the application.
> >
> > It does exactly what it's supposed to do, BUT when I open a
> TitleWindow
> > that has it's 'showCloseButton' attribute set to 'true', the close
> > button doesn't show. Furthermore, all radio buttons in the window
are
> > displayed as regular! buttons. If I load the data on
'CreationComplete'
> > without the custom preloader everything is fine.
> >
> > At first I used the method described in Ted Patrick's tutorial
> > <http://www.onflex.org/ted/2006/07/flex-2-custom-preloaders.php
> <http://www.onflex.org/ted/2006/07/flex-2-custom-preloaders.php> > .
> Then
> > I wrote my own version implementing IPreloaderDisplay instead of
> > extending DownloadProgressBar. Although the latter is more
efficient,
> > keep getting that same bug.
> >
> > Here's what I do on FlexEvent.INIT_COMPLETE (VMain is the view, Main
> is
> > the model, CMain is the controller:
> >
> > var view:VMain = Application.application as VMain;
> > var data:Main = new Main(view.parameters);
> >
> > data.addEventListener(Even! t.COMPLETE,
> > function(event:Event):void ! {
> ; > dispatchEvent(new Event(Event.COMPLETE));
> > });
> >
> > new CMain(view, data);
> >
> > Any ideas? To me it looks like part of the Flex framework isn't
loaded
> > yet. Am I dispatching the event to early?
> > Thanks
> >
>

 

Reply via email to