|
I still haven't found a solution to the problem
described below.
Could you please help me and send me some
suggestion?
Thanks
Alessio
----- Original Message -----
From: Alessio Prosperi
Sent: Thursday, March 24, 2005 10:25 AM
Subject: [flexcoders] drag and drop problem! Hi to everyone,
I developed a e-commerce solution based on
drag'n'drop. I split the main application in small sub-applications so I can
load every section only if it's necessary.
I load every section in a Loader object inside a
Panel (as in Flex samples - drag'n'drop).
I have a component (in the loaded application) that
starts the drag operation.
The problem is: the drag doesn't start when Flex
fires mouseDown event (I have a component inside the application loaded
in the Loader). Why should I change the mouseDown event in
mouseMove event (otherwise the drag doesn't start)?
example:
main.mxml
<?xml version="1.0"
encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Panel title="Start drag from here" width="200" height="200"> <mx:Loader contentPath="drag.mxml.swf" scaleContent="false" width="100%" height="100%" /> </mx:Panel> <mx:Panel title="Drop here" width="200" height="200"> </mx:Panel> </mx:Application> drag.mxml
<?xml version="1.0"
encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> <![CDATA[ function beginDrag() { var ds = new mx.core.DragSource(); ds.addData({name: "test"}, "product"); mx.managers.DragManager.doDrag(this, ds, drag, {mxml: true}); } ]]> </mx:Script> <mx:Image source="@Embed('images/ups.jpg')" scaleContent="false" mouseDown="beginDrag()" /> </mx:Application>
If I run drag.mxml the drag starts correctly. If I run main.mxml the drag doesn't start: I must use mouseMove instead of mouseDown event. Is this a Flex bug? However, even using mouseMove event, the dragged object doesn't exit from the Panel. How can I resolve this situation? If I run the Flex example of drag and drop, the object can move outside its application limits only if the scrollbars are missing. Don't you find it strange? Anyway I don't have scrollbars so this is not my problem I only liked to tell you. I need help as soon as possible!
Alessio Prosperi ------------------------------------------ Adacto s.r.l.
Yahoo! Groups Links
|
- RE: [flexcoders] URGENT: drag and drop problem! Alessio Prosperi
- RE: [flexcoders] URGENT: drag and drop problem! Matt Chotin

