[flexcoders] Why no initial FlexEvent.SHOW event dispatched?

2008-12-02 Thread per.olesen
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, ...



RE: [flexcoders] Why no initial FlexEvent.SHOW event dispatched?

2008-12-02 Thread Alex Harui
Because it never went from visible=false to visible=true.  We argued over this 
for weeks.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
per.olesen
Sent: Tuesday, December 02, 2008 1:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Why no initial FlexEvent.SHOW event dispatched?


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, ...



Re: [flexcoders] Why no initial FlexEvent.SHOW event dispatched?

2008-12-02 Thread Faisal Abid
The show event isnt dispatched on creation of the component, the event  
CreationComplete is dispatched because show, for the compiler means to  
go to the displaylist and show the component, but if the component  
isnt in the displaylist it cant show anything instead it creates it.


So have two handlers, creationComplete (i belive) and show, both  
calling the same method


- Faisal


On 2-Dec-08, at 4:43 PM, per.olesen 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, ...