Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

group sprites 1

Status
Not open for further replies.

missedit

Technical User
Apr 25, 2005
21
GB
I have a flash text box in a movie I want to bring text onto this box and allow both to move together - can you group sprites.

Thank you
 
What I really need here is a way of keeping 2 objects together, so if one is moved the othrer moves with it.
 
If you want to move 2 sprites together in the authoring mode, just select two sprites at the same time and move - but this is obvious so you must be talking about movable sprites during runtime.

There is a type of member called Film Loop, which is basically a group of sprites. To create a film loop, select any number of channels and frames of sprites in the timeline and drag them to an empty slot in a cast window.

However, there's a problem in your case - I don't think text inputs will work once in a film loop.

You can use this thing called LDM or "linked Director movie", which is basically a Director movie within a Director movie - perhaps it's an overkill though.

Or you can write a simple behaviour like this:
[tt]--
property pOffset

on beginSprite me
pOffset = sprite(1).loc - sprite(me.spriteNum).loc
end beginSprite

on exitFrame me
sprite(me.spriteNum).loc = sprite(1).loc - pOffset
end exitFrame
--[/tt]

The sprite with this behaviour will follow the movement of sprite(1).

Kenneth Kawamoto
 
Just apply the behavior MULTIPLE SPRITE DRAG from the libraries.

Good luck, bye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top