Pasted card with a background not included in the number of cds of this bg

Jim Ault jimaultwins at yahoo.com
Thu Jun 24 11:40:57 EDT 2010


On Jun 24, 2010, at 7:33 AM, J. Landman Gay wrote:

> Andre.Bisseret wrote:
>
>> So, if one copy/paste a card including a group whose  
>> backgroundBehavior is set to true, the new card is not a part of  
>> the cards of the background despite the fact that this background  
>> is actually on the card.
>> More, if one clone such a card (resulting of copy/paste) then the  
>> new card is not a part of the cards of the background!!
>
> Yes, because when you copy/paste or clone, you are making a copy of  
> the entire card including the background group. The new group looks  
> identical but is really independent. It is the same as copy/pasting  
> any other control, you get a new one.
>
> -- 
> Jacqueline Landman Gay

The way to see this is to check the ID of the backgrounds.
To include the cards as having the same bg ID, use the Place command.

It is also useful to rename backgrounds so that you don't get confused  
about which one is which.

Also note:  you can have multiple backgrounds on a single card, each  
having its own ID.

In the stack script you could do this discovery technique:
on opencard
   put the backgroundIDs of this stack & "=stk" into  message box
   put cr & the backgroundIDs of this card & "=cd" after  message box
   put cr & the number of groups of this card & "=gr" after  message box
   pass opencard -- in case another handler is waiting for this
end opencard

Also note that 'group' and 'background' are synonymous if the  
background behavior of a group it true.

You can use the Place and Remove as often as you like, since the  
(backgrounds and groups) belong to the stack, not the card.


Hope this helps,


Jim Ault
Las Vegas






More information about the Use-livecode mailing list