cardician
11-30-2009, 06:58 PM
Just as a disclaimer, I'm very new to flex development.
So I've got a webpage with a HDividedBox and a couple of frames. I'm trying to implement code so that when the user double clicks on the divider, the frame to the left automatically minimizes. Seems straight-forward. The problem is that when I double click on the divider, nothing happens and nothing seems to be detected. However, if I double click anywhere other than the divider I can get the code to run and the frame will minimize correctly. I'm hoping someone here can point out my undoubtedly glaring mistake. Here is the summarized code that I'm currently using.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" width="600" height="588"
applicationComplete="start()">
<mx:HDividedBox id="divBox" height="100%" width="99%" doubleClickEnabled="true" doubleClick="handleDoubleClick(event)">
<folders:Folders id="folders" width="15%" height="100%"</folders:Folders>
<mx:Canvas width="100%"></mx:Canvas>
</mx:HDividedBox>
<mx:Script>
<![CDATA[
private var divLoc:int;
private function start():void {
divLoc = 0;
}
private function handleDoubleClick(e:MouseEvent):void {
if (divLoc > 0) {
divBox.getDividerAt(0).x = divLoc;
divLoc = 0;
}
else {
divLoc = divBox.getDividerAt(0).x;
divBox.getDividerAt(0).x = 0;
}
}
]]>
</mx:Script>
</mx:Application>
Note that this is just quick and dirty code to verify that I can get the frame to minimize and to detect the double clicks. As I said, this code runs when I double click anywhere within the HDividedBox, but not when I specifically double click on the divider itself. Then nothing happens.
Any help would be tremendous, thank you.
So I've got a webpage with a HDividedBox and a couple of frames. I'm trying to implement code so that when the user double clicks on the divider, the frame to the left automatically minimizes. Seems straight-forward. The problem is that when I double click on the divider, nothing happens and nothing seems to be detected. However, if I double click anywhere other than the divider I can get the code to run and the frame will minimize correctly. I'm hoping someone here can point out my undoubtedly glaring mistake. Here is the summarized code that I'm currently using.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" width="600" height="588"
applicationComplete="start()">
<mx:HDividedBox id="divBox" height="100%" width="99%" doubleClickEnabled="true" doubleClick="handleDoubleClick(event)">
<folders:Folders id="folders" width="15%" height="100%"</folders:Folders>
<mx:Canvas width="100%"></mx:Canvas>
</mx:HDividedBox>
<mx:Script>
<![CDATA[
private var divLoc:int;
private function start():void {
divLoc = 0;
}
private function handleDoubleClick(e:MouseEvent):void {
if (divLoc > 0) {
divBox.getDividerAt(0).x = divLoc;
divLoc = 0;
}
else {
divLoc = divBox.getDividerAt(0).x;
divBox.getDividerAt(0).x = 0;
}
}
]]>
</mx:Script>
</mx:Application>
Note that this is just quick and dirty code to verify that I can get the frame to minimize and to detect the double clicks. As I said, this code runs when I double click anywhere within the HDividedBox, but not when I specifically double click on the divider itself. Then nothing happens.
Any help would be tremendous, thank you.