RG1967
RG1967

Reputation: 378

Drag and drop on lattice grid- flex

I am trying to build a visual simple electric circuitry model. Towards that

a) I am looking to build a drag & drop functionality, whereby I have items (wires, resistors, battery) that can be dragged and dropped on screen where I have a 10 x10 grid- the dropped items will take line positions on the grid based on where they fall.

Should I do this using the mouseX, mouseY and connect them to grid points they fall closest to? The typical drag and drop examples I have seen, don't concern themselves with exact position in destination- which is obviously important here

Thanks for pointers...

Upvotes: 2

Views: 351

Answers (1)

ddc
ddc

Reputation: 83

If you want a snap-to-grid type functionality, you are on the right track. How you implement this depends on how you implement the component you are dropping on to. If you are using Flex 4, you could look into writing a custom layout to implement it as well.

Upvotes: 1

Related Questions