madhavi chinni
unread,Oct 26, 2012, 10:59:59 PM10/26/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to flex_...@googlegroups.com
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