PaneStylesExample, action button over titlebar

edgargarciasanchez
Posts: 14
Joined: 2007-08-30

have good day ...
hi ...

I have checked your example PaneStylesExample.mxml, in your code or script you defined one TitleBar ,

title="Figure #1"
titleBarStyleName="titleBarFigure1"
styleName="figure1"
width="200" height="200" showCloseButton="true" showMaximizeButton="true" showTitleBar="true">

width="100%" height="100%"/>

.

I like to do an acction, when i press cliclk at the closeButton or MaximizeButton, how do i do.

i used your function init(), and append one line.

private function init():void{
var placement:String = titleBarPlacement.selectedItem.data;

pane1.titleBarPlacement = placement;
pane2.titleBarPlacement = placement;
pane3.titleBarPlacement = placement;
pane4.titleBarPlacement = placement;
pane5.titleBarPlacement = placement;
pane6.titleBarPlacement = placement;
pane7.titleBarPlacement = placement;
/* I append this line*/
pane1.titleBar.addEventListener(TitleBarEvent.CLOSE_BUTTON_CLICK,close);
}

private function close():void{
Alert.show('Hello');

}

but this dont work , i press , no appear error on my display, but i press click on button close, my aplication dont do nothing.

I hope you hunderstand me
thank you.

Comments
ccallendar
Posts: 4
Joined: 2008-04-03

One way to do this is to add a mouse click listener directly on the close button like this:

pane1.titleBar.closeButton.addEventListener(MouseEvent.CLICK,close);

Privacy Policy | Copyright Notice| Disclaimer| Product EULA
©2003-2008 Teoti Graphix, LLC - All rights reserved.