Does anyone know if there's an event that the PopupManager is listening for, that triggers the dragging functionality?

I'm trying to create custom buttons in the title area of a TitleWindow, that trigger custom events. However, when I use a skin to place buttons on top of the TitleWindow, they're getting covered by whatever hidden button flex uses to trigger that drag functionality. Therefore, I'd like to create my own window, that triggers that secret event I'm looking for.

If anyone has a better solution, please let me know!

Here's my popup code:

private var p1:DisplayObject;
           
private function init() {

                p1 = DisplayObject(PopUpManager.createPopUp(this, comps.TestPanel, false));
}

here's the TestPanel code, where TitleSkin is just an HBox with buttons:

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow    
xmlns:mx="http://www.macromedia.com/2005/mxml"
xmlns="*" 
width="438"
height="300"   
layout="absolute"
backgroundAlpha="1"
panelAlpha="1"   
marginTop="10" marginBottom="10" marginLeft="10" marginRight="10"
mouseDown="click()"
mouseMove="drag()"
mouseUp="msUp()"

titleBackgroundSkin="TitleSkin"

title="Default Title">   
       
        <mx:Script>
            <![CDATA[
                import mx.controls.Alert;
               
                public var msDown:Boolean;
               
                private function click() {
                    msDown = true;
                    dispatchEvent(new Event('click'));
                }
                private function drag() {
                    //Alert.show("click()");
                    if(msDown) {
                        this.alpha = .2;
                    }
                }
                public function msUp() {
                    msDown = false;
                    this.alpha = 1;
                }
               
            ]]>
        </mx:Script>
       
        <mx:ControlBar width="100%">
            <mx:Label text="Quantity"/>
            <mx:NumericStepper id="myNS"/>
            <!-- Use Spacer to push Button control to the right. -->
            <mx:Spacer width="100%"/>
            <mx:Button label="Add to Cart" />
        </mx:ControlBar>
   
    </mx:TitleWindow>

: : ) Scott

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to