Hi,
There is an open source component CanvasButtonAccordionHeader in Flexlib
library.All you need to do is download the source code or swc and use it in
flex.
Below is the site for the documentation with an example

http://code.google.com/p/flexlib/wiki/ComponentList
http://flexlib.googlecode.com/svn/trunk/examples/CanvasButtonAccordionHeader_Sample.swf


Let me know for any additional help .

Thanks,
Venu

On Sat, Oct 27, 2012 at 8:29 AM, madhavi chinni <[email protected]
> wrote:

>
> Hi,
> I have created a custom Accordian Header and I have added a
> button,image,linkButton in the Accordian header.
> I want to perform a functionality in the click event handler of the button
> which is added in the Accordian header,but the code in the click event
> handler of the button added in the Accordian header is not called.
> I tried alerting a statement in the click event handler of the button
> added in the Accordian header,but the alert statement is not printed.
> Any help is greatly appreciated :) .  Its Urgent!!!
> Please find the code snipplet pasted below.
>
> public class CustomAccordianHeader extends AccordionHeader
>     {
>
>
>         [Bindable]
>         [Embed(source="assets/plus.jpg")]
>         private var AccordionIcon:Class;
>
>         //private var extraButton : Button = new Button();
>         private var extraButton : CustomButton = new CustomButton();
>         private var image:Image = new Image();
>         private var extraLink:LinkButton = new LinkButton();
>         private    var box:HBox = new HBox();
>
>
>
>         public function CustomAccordianHeader()
>         {
>             super();
>             this.setStyle("skin",comp.CustomSkin);
>             this.useHandCursor =  true;
>             this.mouseChildren =  true;
>             this.buttonMode =  true;
>             this.addEventListener(MouseEvent.CLICK,showHeader);
>
>             image.source = AccordionIcon;
>
>             //extraButton.label= "hello";
>             //extraButton.addEventListener(MouseEvent.CLICK,displayHi);
>
>
>             //extraButton.buttonMode = true;
>             //extraButton.useHandCursor = true;
>             //extraButton.mouseChildren =  true;
>
>             extraLink.label = "Madhu";
>             extraLink.addEventListener(MouseEvent.CLICK,displayHello);
>             extraLink.buttonMode = true;
>             extraLink.useHandCursor = true;
>             extraLink.mouseChildren =  true;
>         }
>
>         override protected function createChildren():void{
>             super.createChildren();
>
>             box.addElement(extraLink);
>             box.addElement(image);
>             box.addElement(extraButton);
>
>             addChild(box);
>         }
>
>         public function showHeader(event:MouseEvent):void{
>             Alert.show("header");
>         }
>
>
>         override protected function updateDisplayList( unscaledWidth :
> Number, unscaledHeight : Number ) : void {
>             super.updateDisplayList(unscaledWidth, unscaledHeight);
>
>             /* extraButton.setActualSize(50, unscaledHeight - 6);
>             extraButton.move(unscaledWidth - extraButton.width - 3,
> (unscaledHeight - extraButton.height)/2);  */
>             box.setActualSize(200, unscaledHeight - 6);
>             box.move(unscaledWidth - box.width - 3, (unscaledHeight -
> box.height)/2);
>         }
>
>         public function displayHi(event:MouseEvent):void{
>             Alert.show("hi");
>         }
>
>         public function displayHello(event:MouseEvent):void{
>             Alert.show("hello");
>         }
>     }
>
> Thanks & Regards,
> Madhavi
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/flex_india/-/W5c8DsWWXigJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>



-- 
Venu Reddy

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to