> Initially each piece group property is an empty array, but for a group
> something like:
>
> A B C
> D
>
> then, A.group is an array of (B, C, D). B.group is an array of (A, C, D),
> etc..

Without going into your post in detail, I think this is the source of your
problem. For each group, you're better off making a single object which
contains all the elements in it, then making A.group a reference to that
object. Start with N such groups, one for each piece. Then, when you connect
two pieces, you merge their groups into a single object. Now, each time the
user drags a piece, update the whole group (including the piece clicked on)
with a single command.

Another advantage of this approach is that it makes it easy to do other
group-level operations like depth-sorting, and of course the puzzle is
solved when there is only one group!

Danny

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to