copy group to card
Thomas McGrath III
3mcgrath at comcast.net
Mon Apr 7 14:50:19 EDT 2008
I am copying from a library stack via script. The library stack is not
the same dimensions etc. as the stack I am copying too. I will look
into the place to see if that is better. The thing is I will have
dozens of these groups to swap out on the main card and it seemed that
copy was a great way to temporarily display them and then I delete
them when needed.
The problem I was having was that after a copy the on newGroup was
being passed and I trapped it in the new group (from the template) but
the internal script messages were not all working. So I moved the on
newGroup to the card I was copying to and checked what group it was
coming from and now it works as expected.
It works like a prop message.
On Apr 7, 2008, at 12:47 PM, Mark Schonewille wrote:
> Hi Tom,
> First of all, why would you want to copy a group? The good thing
> about groups is that you can place them on multiple cards. This
> means that you need only one object, or group of objects, which can
> save you a lot of memory.
> Second, if you do this by script, you could send a special message
> up the message hierarchy right before placing the group. If you do
> this manually, no special message is sent. After you have placed the
> group, the selectedObjectChanged message is sent. This might be of
> help, because you could check whether the selectedObject is a group
> and whether it is in a list of previously created groups. Another
> message that is sent if you choose Place from the menu, is the
> menuPick message. I haven't tried whether it is possible to catch
> this message before the group is placed.
> If you really want to copy and paste a group manually in the IDE and
> want to handle a message sent before or after pasting, you could
> handle the commandKeyDown message. This even allows you to prevent
> the group from being created.
> Best regards,
> Mark Schonewille
More information about the Use-livecode