2

I have an Flash component using ActionScript 3, which supports drag and drop. I have a requirement to drag something out of the Flash app and drop it elsewhere on the page.

I can do drag and drop within the HTML page using HTML5's drag and drop support, but I'm not sure how to integrate this with the drag and drop within the Flash app.

One idea would be to detect a drag leaving the Flash stage, and trigger an HTML DOM element's drag using JavaScript. However I'm not sure how to trigger an HTML element to start being dragged without actually clicking on it. Is this possible, or alternatively is there some other way to span drag-and-drop between Flash and HTML5?

  • Duplicate of http://stackoverflow.com/questions/82509? – Rich Sep 13 '15 at 22:13
  • I think that potential duplicate might cover it, although not as far as I can tell with HTML5, so this question still has relevance. (Also the links to the solution on that answer don't work any more!) – Matthew Richards Sep 14 '15 at 07:52
  • There's no connection between Flash graphic elements and HTML graphic elements so when the Flash element begins to be dragged you will have to replace it with a HTML element directly on top of Flash. No dragging occur in Flash all dragging occur in HTML. – BotMaster Sep 14 '15 at 19:50
  • Thanks. I can invoke JavaScript from Flash; but is it possible to use HTML5 drag-and-drop support in this way? What I'd ideally like is to be able to trigger an HTML element to start dragging programmatically from JavaScript. Otherwise I think I could only achieve this by putting an HTML element on top of the Flash permanently, which would presumably stop the mousedown event from hitting the Flash stage (I'd need to handle *all* drag and drop from HTML, rather than letting the Flash handle it for the subset of drag-drops that stay within the Flash app). – Matthew Richards Sep 15 '15 at 07:53

0 Answers0