One more thing:  It is related to mouseDown in a TextField which is in
the Panel title.  In my testing, if I grab the white content area and
drag I do not have a problem.  Makes me think that if you put an alpha=0
sprite over the textfield in the panel's title it might work better in
IE, but I don't have time to try it.
 
FWIW, my test case is:
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute"
viewSourceURL="srcview/index.html" creationComplete="init()">
<mx:Script>
<![CDATA[ 
 
private var lastX:Number;
private var lastY:Number;
 
private function init():void
{
pnl.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
 
private function onMouseDown(event:MouseEvent):void
{
lastX = event.stageX;
lastY = event.stageY;
pnl.addEventListener(MouseEvent.MOUSE_UP, onLeave);
pnl.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
systemManager.stage.addEventListener(Event.MOUSE_LEAVE, onLeave);
}
 
private function onMove(event:MouseEvent):void
{
 var deltaX:Number = event.stageX - lastX;
 var deltaY:Number = event.stageY - lastY;
 
 lastX = event.stageX;
 lastY = event.stageY;
 
 pnl.move(Math.max(0, Math.min(100, pnl.x + deltaX)),
    Math.max(0, Math.min(100, pnl.y + deltaY)));
 
}
 
private function onLeave(event:Event):void
{
pnl.removeEventListener(MouseEvent.MOUSE_UP, onLeave);
pnl.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
systemManager.stage.removeEventListener(Event.MOUSE_LEAVE, onLeave);
 
}
]]>
</mx:Script>
<mx:Panel id="pnl" width="400" height="300" title="Panel One" />
</mx:Application>


________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Wednesday, September 26, 2007 10:55 PM
To: [email protected]
Subject: RE: [flexcoders] Re: MOUSE_LEAVE never fires in IE if drag with
bounds is active



Actually, the player team already has a bug for this issue.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Wednesday, September 26, 2007 10:13 PM
To: [email protected]
Subject: RE: [flexcoders] Re: MOUSE_LEAVE never fires in IE if drag with
bounds is active



I see.  I dind't realize you were saying that MOUSE_LEAVE doesn't work
properly in IE at all.  I thought you were saying that startDrag() was
messing it up.
 
So yeah, I tried it myself and it isn't working right.  I don't think
you even need to startDrag(), just listen for MOUSE_LEAVE and it seems
you don't get it.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: Wednesday, September 26, 2007 2:07 PM
To: [email protected]
Subject: [flexcoders] Re: MOUSE_LEAVE never fires in IE if drag with
bounds is active



I am dragging a panel. MOUSE_UP_OUTSIDE_STAGE accurately describes
what happens in Firefox, but in IE nothing fires at all. If you run
the code from my initial post in both browsers you will see what I mean.

> It does not fire when you drag out of the stage.
Not sure what you mean by that since in order to know about a
MOUSE_UP_OUTSIDE_STAGE the mouse button would obviously have to be
down when the mouse leaves the stage.

> you can do that
How?

> (but you can't change the mouse cursor position)
Not sure I follow.

Thanks,
Ben

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> In your snippet, it looked like you were trying to drag a panel. Is
that
> true or are you dragging components in a panel?
> 
> Maybe I don't get what is wrong with IE and MOUSE_LEAVE because as far
> as I know MOUSE_LEAVE does work. It really should be called
> MOUSE_UP_OUTSIDE_STAGE. It does not fire when you drag out of the
> stage.
> 
> If your goal is to keep the dragged thing within a certain portion of
> the screen, you can do that (but you can't change the mouse cursor
> position).
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of ben.clinkinbeard
> Sent: Wednesday, September 26, 2007 10:15 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: MOUSE_LEAVE never fires in IE if drag with
> bounds is active
> 
> 
> 
> I will definitely file a bug against the player but in my initial
> exploration am seeing some deal-breaker shortcomings of both
> DragManager and Panel's built-in approach. Panel's
> stage_mouseLeaveHandler() listens for MOUSE_LEAVE so it suffers from
> the same fate as startDrag(). DragManager, as far as I can tell,
> provides no way to limit the drag area. DragManager also doesn't seem
> to provide any (easy) way to do live dragging. I assume the only way
> to accomplish it would be to copy the dragged component into a
> ByteArray and use that as an Image's source for the dragProxy.
> 
> As I said, these are only based on initial tests so please let me know
> if there is something I am overlooking. As it turns out I really hope
> that is the case.
> 
> Thanks,
> Ben
> 
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > You should file against the player. They should fix it. However,
since
> > that scenario is not recommended in Flex, I'm not going to verify
it.
> > And yes, use DragManager or your own code (Panel has its own code)
> > 
> > ________________________________
> > 
> > From: [email protected]
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected]
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of ben.clinkinbeard
> > Sent: Wednesday, September 26, 2007 6:10 AM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: MOUSE_LEAVE never fires in IE if drag with
> > bounds is active
> > 
> > 
> > 
> > Hi Alex,
> > 
> > Not quite sure how to take your comment. Do you mean "file it
against
> > the player" or "whatever"?
> > 
> > Regarding the avoidance of startDrag/stopDrag, I take it you mean I
> > should rewrite the code to utilize DragManager?
> > 
> > Thanks,
> > Ben
> > 
> > --- In [email protected]
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > , "Alex Harui" <aharui@> wrote:
> > >
> > > Go ahead and file it if you want. I'm not even going to bother to
> > > confirm. It is a player API. We avoid startDrag/stopDrag for many
> > > other reasons and handle dragging in separate code in Flex
> > > 
> > > ________________________________
> > > 
> > > From: [email protected]
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > [mailto:[email protected]
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > ] On
> > > Behalf Of ben.clinkinbeard
> > > Sent: Tuesday, September 25, 2007 9:37 PM
> > > To: [email protected]
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com> 
> > > Subject: [flexcoders] MOUSE_LEAVE never fires in IE if drag with
> > bounds
> > > is active
> > > 
> > > 
> > > 
> > > The behavior is just like if you drag past the bounds and release
> > > without having defined a MOUSE_UP listener for the stage. This
makes
> > > it impossible to cancel a drag operation if the user's mouse
leaves
> > > the stage with the mouse button down. Again, this is only in IE.
> > > Pretty sure this is a bug but will wait for confirmation before
> > > filing. Complete test case below.
> > > 
> > > Thanks,
> > > Ben
> > > 
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> 
> <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> > 
> > <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml>
<http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> > > 
> > > <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml>
<http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> >
> <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml>
<http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> > > > "
> > > layout="absolute"
> > > viewSourceURL="srcview/index.html" creationComplete="init()">
> > > <mx:Script>
> > > <![CDATA[ 
> > > private function init():void
> > > {
> > > pnl.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
> > > pnl.addEventListener(MouseEvent.MOUSE_UP, onLeave);
> > > }
> > > 
> > > private function onMouseDown(event:MouseEvent):void
> > > {
> > > pnl.startDrag(false, new Rectangle(0, 0, 100, 100));
> > > systemManager.stage.addEventListener(Event.MOUSE_LEAVE, onLeave);
> > > }
> > > 
> > > private function onLeave(event:Event):void
> > > {
> > > pnl.stopDrag();
> > > systemManager.stage.removeEventListener(Event.MOUSE_LEAVE,
onLeave);
> > > }
> > > ]]>
> > > </mx:Script>
> > > <mx:Panel id="pnl" width="400" height="300" title="Panel One" />
> > > </mx:Application>
> > >
> >
>



 

Reply via email to