Interesting, looks like DragManager was never written to handle multiple AIR windows.
I did see that there is an undocumented event dispatched by the dragManager called “popUpChildren”. I haven’t tried it, but it looks like if you listen for that event and call event.preventDefault, you can reparent the DragProxy that is referenced in the event. You should addChild the dragProxy in the systemManager.popUpChildren for the desired AIR Window. HTH, -Alex On 8/9/15, 2:51 PM, "Dave Glasser" <[email protected]> wrote: >Thanks Rudolf, but that didn't work. Same exact behavior. And what's >interesting is that the mouse cursor appears over the main application >window when I'm dragging as well. It disappears in the window in which >I'm dragging, but the app is obviously tracking the mouse location in the >window in which I'm dragging, because when I (blindly) drag over >something that won't accept the drop, the mouse cursor gets the >additional red circle-X, and when I (blindly) drop over something that >can accept it, the drop code works as expected. > > From: Rudolf Schnetler <[email protected]> > To: [email protected]; Dave Glasser <[email protected]> > Sent: Sunday, August 9, 2015 5:11 PM > Subject: Re: Using Flex Drag Manager in AIR WindowedApplication > >Try setting setting 'mouseChildren = false' in the application window >before dragging and to true when drag finished. > > > > > >On Mon, Aug 10, 2015 at 5:22 AM, Dave Glasser <[email protected]> wrote: > >> I'm using Flex 4.13.0. I'm porting a browser-based Flex app to the AIR >> platform, as a multi-window application. The main window will be used to >> configure server connections, and the child windows will be login >>sessions >> to individual servers -- essentially what you would see in the >> browser-based application. >> >> The code already uses a lot of drag/drop that works well in the browser. >> It didn't work so well in the AIR app, so I switched the AIR app to not >>use >> the native drag manager, but rather the same DragManagerImpl class as >>the >> browser app, by doing this in the main MXML file: >> >> <s:WindowedApplication >> xmlns:fx="http://ns.adobe.com/mxml/2009" >> xmlns:mx="library://ns.adobe.com/flex/mx" >> xmlns:s="library://ns.adobe.com/flex/spark" >> useNativeDragManager="false"> >> >> >> Anyway, a lot of the problems I had with the native drag manager have >>gone >> away. But there's one huge new problem. The DragProxy is parented by the >> main application window, so while I'm dragging something within a child >> window, I see my dragImage (which is parented by the DragProxy) moving >> around within the main application window. >> >> In DragManagerImpl.doDrag(), I see this: >> >> // The drag proxy is a UIComponent with a single child - >> // an instance of the dragImage. >> dragProxy = new DragProxy(dragInitiator, dragSource); >> >> var e:Event; >> if (hasEventListener("popUpChildren")) >> e = new DragEvent("popUpChildren", false, true, dragProxy); >> if (!e || dispatchEvent(e)) >> sm.popUpChildren.addChild(dragProxy); >> >> >> And here, sm seems to always be the ISystemManager of the main >>application >> window. I don't see any other code where the DragProxy is added to the >> display list. >> >> >> Does anyone have any ideas how I can get this to work? >> >> >> >> > > >
