When a UIComponent is set to visible for the first time by the
LayoutManager, the SHOW event is suppressed.  The CREATION_COMPLETE
event fired immediately after that call to setVisible, so you should
be able to achieve whatever effect you're going for by registering the
same function to listen for both the SHOW and CREATION_COMPLETE events.

--- In flexcoders@yahoogroups.com, "per.olesen" <[EMAIL PROTECTED]> wrote:
>
> I was wondering why a flex control or container does not dispatch a
> FlexEvent.SHOW when showing the first time? Given this code:
> 
> <mx:Panel 
>   id="panel" 
>   show="Alert.show('I am showing')" 
>   creationComplete="Alert.show('I was created')"/>
> 
> <mx:Button 
>   click="panel.visible = !panel.visible" 
>   label="Show/Hide"/>
> 
> When the "panel" Panel is constructed, the creationComplete is fired
> and I see my Alert "I was created". But I DO NOT get the Alert "I am
> showing".
> 
> If I then click the button to hide it and click it again to show it, I
> am getting the show event.
> 
> Why no show event initially?
> 
> This applies equally well to TitleWindow, Button, Box, ...
>


Reply via email to