This works ok but performs terribly. I just can't get the panel 
update fast enough to follow the mouse. Any help?

<?xml version="1.0"?>
<mx:Application  initialize="setListeners();" frameRate="36" 
xmlns:mx="http://www.adobe.com/2006/mxml"; width="100%" height="100%">
   
<mx:Script>
        <![CDATA[
                public function setListeners():void
                {
                resizeButton.addEventListener
((MouseEvent.MOUSE_MOVE), myPanelResizer);
                }
        
                public function removeResizer():void
                {
                myPanel.removeEventListener((MouseEvent.MOUSE_MOVE), 
myPanelResizer);
                }
                
                public function myPanelResizer(e:MouseEvent):void 
                {
                        if(e.buttonDown)
                        {
                        e.target.parent.parent.width = 
e.target.parent.parent.mouseX +20;
                        e.target.parent.parent.height = 
e.target.parent.parent.mouseY +20;
                        }
                        e.updateAfterEvent();           
                }

        ]]>
</mx:Script>  


        <mx:Panel id="myPanel"
                mouseUp="removeResizer();"
                horizontalScrollPolicy="off" 
                verticalScrollPolicy="off" 
                dropShadowEnabled="true"
            shadowDistance="3"
            shadowDirection="center"            
                width="580" 
                height="380" 
            >
                
        <mx:Canvas id="body"  
                width="100%" 
                height="100%" 
                horizontalScrollPolicy="off" 
                verticalScrollPolicy="off">
        <mx:Button  id="resizeButton" 
                label="drag"
                x="{body.width-resizeButton.width}" 
                y="{body.height-resizeButton.height}"   
                 />
        </mx:Canvas>
        </mx:Panel>

    
</mx:Application>










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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to