At 12:46 PM 30/04/01 +0400, you wrote:
>Hi!
>Is possible to group two or more sprites?
>so that if one of the (bottommost) sprites is draggle
>the grouped once move with it?
yah, it's possible. let me just dig around in my code morgue here...
the following scripts allow you to use one sprite as the controlling
sprite. the other sprites end up being essentially just "decoration" until
the controlling sprite moves them around.
attach this behaviour to the non-controlling sprite(s):
on move me, moveAmount
sprite(me.spriteNum).loc=sprite(me.spriteNum).loc + moveAmount
end
and this behaviour to the controlling sprite (note that this will, as i
said, force your non-controlling sprites to be essentially useless -- they
cannot be pushed around the stage):
property pPressed
on beginSprite me
pPressed=false
end
on mouseDown me
pPressed=true
end
on mouseUp me
pPressed=false
end
on mouseUpOutside me
pPressed=false
end
on exitFrame me
if pPressed then
moveAmount=the mouseLoc - sprite(me.spriteNum).loc
sprite(me.spriteNum).loc=sprite(me.spriteNum).loc + moveAmount
sendAllSprites(#move,moveAmount)
end if
end
(YES... that 'on exitFrame' *should* be in the sprite behaviour.)
good luck with it.
cheers,
parker
--
"But that was in another country, and besides, the wench is dead."
- C Marlowe, "The Jew of Malta"
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]