views:

163

answers:

1

Hi,

I would like to add an title Icon image to a Panel, but cant find the click event on that icon,

+2  A: 

The titleIconObject of the Panel class is declared as an mx_internal variable, so if you want to do anything with it you will probably have to extend Panel and override it and some of the methods that reference it.

EDITED TO INCLUDE FURTHER INFORMATION FROM MY COMMENT:

@seismael: Actually, upon further review, a better way would be to override commitProperties and handle it there. Open up the Panel class in the SDK and look for the section beginning if (_titleIconChanged) (in the current SDK I'm using it's line 1168). Just do super.commitProperties() and then adjust that conditional block to add your event listener for _titleIcon, etc

Robusto
aha... that needs a lot of explanation... so the override is not regular?? how should i override an mx_internal panel variable??
seismael
things in `mx_internal` namespace might change in subsequent versions - its not wise to rely on them.
Amarghosh
@seismael: Actually, upon further review, a better way would be to override commitProperties and handle it there. Open up the Panel class in the SDK and look for the section beginning `if (_titleIconChanged)` (in the current SDK I'm using it's line 1168). Just do `super.commitProperties()` and then adjust that conditional block to add your event listener for _titleIcon, etc.
Robusto
Hi, thanks for the answer, could you write it as an answer and not a comment, because if i do accept the answer others will not notice that the answer in the comment.
seismael
@seismael: done
Robusto