[AS]
<?xml version=“1.0” encoding=“utf-8”?>
<mx:Application xmlns:mx=“http://www.adobe.com/2006/mxml” layout=“absolute” themeColor=“haloGreen”>
<mx:Script>
<![CDATA[
private function initTW():void {
setTWEvents();
}
private function setTWEvents():void {
bg_tw.addEventListener(MouseEvent.MOUSE_DOWN, drag);
bg_tw.addEventListener(MouseEvent.MOUSE_UP, drag);
}
private function drag(info:MouseEvent):void {
if (info.type == "mouseDown") {
bg_tw.startDrag();
} else {
bg_tw.stopDrag();
}
}
]]>
</mx:Script>
<mx:TitleWindow id="bg_tw" width="500" height="400" layout="absolute" showCloseButton="true" title="Background Settings" x="76" y="10" creationComplete="{initTW()}">
<mx:Accordion includeInLayout="true" right="0" left="0" top="0" bottom="40">
<mx:VBox label="background image" width="100%" paddingLeft="10" paddingTop="10">
<mx:Tree />
</mx:VBox>
<mx:VBox label="background image position" width="100%" paddingLeft="10" paddingTop="10">
<mx:RadioButtonGroup id="backgroundImagePosition_rbg" />
<mx:RadioButton groupName="backgroundImagePosition_rbg" id="rb1" value="Center" label="Center" name="Center"/>
<mx:RadioButton groupName="backgroundImagePosition_rbg" id="rb2" value="Center" label="Tile"/>
<mx:RadioButton groupName="backgroundImagePosition_rbg" id="rb3" value="Center" label="Fill"/>
<mx:RadioButton groupName="backgroundImagePosition_rbg" id="rb4" value="Center" label="Stretch"/>
</mx:VBox>
<mx:VBox label="background color" width="100%" paddingLeft="10" paddingTop="10">
<mx:ColorPicker />
</mx:VBox>
</mx:Accordion>
<mx:HBox paddingBottom="10" paddingRight="10" horizontalAlign="right" right="0" bottom="0">
<mx:Button label="OK" id="bg_OK" />
<mx:Button label="CANCEL" id="bg_CANCEL" />
</mx:HBox>
</mx:TitleWindow>
</mx:Application>
[/AS]
I want to drag only when I click on the window titlebar. It drag me all TW, what have to change to accomplish that?