is how to handle all the Drag/Drop logic with the
Icons,

Sounds interesting. :)

I would make a component, MapViewer extends UIComponent.

Composite 2 components into this component.

- MapLoader extends SWFLoader
- MapAssets extends Canvas

MapViewer will be the control into positioning the icons as your drop them
INTO the MapAssets aka the map assets instance is position 0,0 with the
MapLoader right on top. MapView sizes and positions the MapLoader and
MapAssrts instances.

Once you have this base set up, set your tool bar

- drag off the tool bar, create a dragData object with a new instance of the
said icon,
- user drops icon onto MapViewer
- MapViewer konws how to accept dragDrop, then processes the x,y position
converts coords, takes that new instance you created from the tool bar
factory and addChild() into the MapAssets component precisely where the user
dropped it.

Now that the icon is perfectly placed INSIDE the MapAssets instance as the
user pans the map around, them icon follows because the MapViewer is
positioning the MapLoader along with the MapViewer.

May or may not make sense but from what you described I could easily get
that scenario going.

Peace, Mike



On 2/3/07, lostinrecursion <[EMAIL PROTECTED]> wrote:

  I agree. AS3 actually has the most incredible drag and drop support
and it is also very easy to implement via Flex. In fact, all List
based components have this functionality native to them.

But adding it to a non list base component isn't awfully hard either.
Look in the docs for drag and drop and look for "Image to a Canvas"
examples on drag/drop - I believe that ought to answer many of your
questions.

Good luck with the app. Sounds heavy.
-Kenny




--
Teoti Graphix
http://www.teotigraphix.com

Blog - Flex2Components
http://www.flex2components.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to