I do this all the time. I have two embedded images that are set as
bindable (openNav and closeNav). The image source is dependent on a
property named isOpen. I have attached a click handler to the image:
<mx:Image source="{isOpen == false?(openNav):closeNav}"
useHandCursor="true" buttonMode="true" mouseChildren="false"
id="thisToggleImage" click="toggleAccordionItem()" right="5" top="5" />
The toggleAccordionItem function just runs an effect to open or close my
panel.
private var shrinkBox:Resize = new Resize();
private var growBox:Resize = new Resize();
private function toggleAccordionItem():void
{
if(isOpen)
{
shrinkBox.duration = 500;
shrinkBox.target = thisAccordionItem;
shrinkBox.end();
shrinkBox.heightTo = 21;
shrinkBox.play();
}
else
{
growBox.target = thisAccordionItem;
growBox.end();
growBox.heightTo = 300;
growBox.play();
}
isOpen = !isOpen;
}
--- In [email protected], "pratikshah83" <[EMAIL PROTECTED]>
wrote:
>
> Hi ,
>
> I am currently using a collapsible panel. It expands or collapse when
> we click the panel header. Currently I have an event on the titleBar.
> I have an open and close arrow image set as titleIcon property, I
> would like to add a click event on that arrow image property instead
> of the titleBar.
>
> Any help in this regards is appreciated.
>
> Thanks
> Pratik
>