> Hello Danny,
>
> So for every piece generated, i'll create as much piece and group
> objects in
> each piece and group array beyond the piece MC object scope,
> right? But how
> does moving all pieces simultaneously be done in pseudocode? How would you
> tell an object to start drag?.. I mean, since only MCs have the startDrag
> method, then it will need to delegate to group object, or do you have a
> better way doing this?

Yes: don't use the inbuilt drag method, do it with code (following is email
script and may contain errors!):

function myStartDrag() {
startX = _parent._xmouse
startY = _parent._ymouse
myX = this._x
myY = this._y
drag = true
}
function myStopDrag() {
drag = false
}
function onEnterFrame() {
if (drag) {
this._x = _parent._xmouse - startX + myX
this._y = _parent._ymouse - startY + myY
}
}

By the way - on thinking further, I'd not even bother with piece objects
(they're just simple movieclips) but only use groups. A group knows all its
neighbours and if any of them are in a group that's in the same relative
position to its starting point, it joins them together. Then its new list of
neighbours is all the neighbours of the two groups except those that are in
the group.

eg:

group 1 has pieces C and D and neighbours A,B,E,F
group 2 has pieces E and G and neighbours B,H,C,I

piece C in group 1 is a neighbour of group 2 so the two can join together.
When joined, they have pieces C,D,E,G and neighbours A, B, F, H, I

Don't know if that is very clear!
Danny

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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