Page 1 of 1

place backgrounds with backgroundBehavior to existing cards

Posted: Thu Feb 16, 2012 8:52 am
by ueliweb
Hei

how I can place backgrounds with backgroundBehavior to existing cards?
If I create new cards this backgrounds will be placed automatical to the new card and they have all the same ID.

As I created many cards with very different functionality but I would like to add new background with backgroundBehavior, it looks so that I need to create new card and copy all object and scripts to the new card ...

is ther no way to palce it easy to existing cards? any suggestions?


thanks

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Thu Feb 16, 2012 9:55 am
by bn
Hei,

you can add manually backgrounds to existing cards by going to that card and then in the menu Object menuitem Place Group will be enabled. It offers you to place any of your backgrounds that are not already on the card.
Bildschirmfoto 2012-02-16 um 09.46.02.png

Alternatively you can use the place command to add a background to an existing card

Code: Select all

on mouseUp
   go card 3
   place background "myBackGround" onto this card
   go card 1
end mouseUp
See "place" command in the dictionary.

Kind regards

Bernd

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Thu Feb 16, 2012 9:58 am
by jmburnod
Hi ueliweb
Salut Bernd,

Code: Select all

place group "Mygrouo" onto cd 2
work also
Best regards

Jean-Marc

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Thu Feb 16, 2012 10:18 am
by ueliweb
Bernd,
Jean-Marc,

Thanks very much!
Just to now how the key word to find it.

Whereas I wrote 'place' in this topic I diden't searched with it befor :(
Now I found it also in the LC User Guide ...

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Thu Feb 16, 2012 10:21 am
by jmburnod
Hi ueliweb

Bernd is right (one more)

Code: Select all

place group "Mygrouo" onto cd 2
work if the group is not a background

but not if it is a background

Best regards

Jean-Marc

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Thu Feb 16, 2012 7:54 pm
by Klaus
Bonsoir Jean-Marc,
jmburnod wrote:

Code: Select all

place group "Mygroup" onto cd 2
work if the group is not a background
but not if it is a background
yes, but this will work:

Code: Select all

place bg "Mygroup" onto cd 2
no matter if "Mygroup" is a group or a (group with) background (behavior)! :D

The difference between "group" and "background" is just the way LiveCode sees and counts ALL groups!
If you:

Code: Select all

put the number of groups
you will get the number of groups of the CURRENT card where the script is executed!

If you:

Code: Select all

put the number of backgrounds
you will get the number of ALL groups in the current stack where the script is executed, background behavior set or not!

Isn't it amazing? 8)


Best

Klaus

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Thu Feb 16, 2012 8:27 pm
by jmburnod
Guten Abend Klaus,

Code: Select all

place bg "Mygroup" onto cd 2
Yes, i tried that after my second post, but you're faster

Best from Geneva

Jean-Marc

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Wed Jul 04, 2012 9:58 am
by fredigertsch
Guten Tag Klaus

And why

place bg "mygroup" does function and place background "mygroup" does not?

Best, Fredi

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Wed Jul 04, 2012 11:31 am
by Klaus
Hi Fredi,
place bg "mygroup" does function and place background "mygroup" does not?
bg = background!?

If you mean the difference between "group" and "background", see my post above.


Best

Klaus

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Wed Jul 04, 2012 11:46 am
by fredigertsch
Hi Klaus

Yes, when I write "bg" (for background) then it does function but when I write "background" it does not. But it does move the group to the new card and I like only to copy the group??? I have several different groups on a card "vorlagen". Then I add a new card and I want to copy one of the groups on this card (it depends the type of the card). How I have to made it? Thanks.

Regards, Fredi from Switzerland

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Wed Jul 04, 2012 11:59 am
by Klaus
Grüezi Fredi,
fredigertsch wrote:Hi Klaus
Yes, when I write "bg" (for background) then it does function but when I write "background" it does not.
Really??? Lazy moi alway uses the abbreviations, so I never noticed his :D
fredigertsch wrote:...But it does move the group to the new card and I like only to copy the group?
It does not move the group! It is still on the original card but also on the new card where you placed it.
It is in fact the SAME group!
fredigertsch wrote:I have several different groups on a card "vorlagen". Then I add a new card and I want
to copy one of the groups on this card (it depends the type of the card). How I have to made it? Thanks.

Regards, Fredi from Switzerland
You already mentioned it!

If you really want to copy a group, well then:
...
copy grp "xyz" of cd "vorlagen" to cd 2
...
should do the trick 8)


Best

Klaus

Re: place backgrounds with backgroundBehavior to existing ca

Posted: Wed Jul 04, 2012 4:02 pm
by fredigertsch
Thank you Klaus - you are right.