Place group of a card to a new card in a substack?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
3d-swiss
Posts: 39
Joined: Thu Nov 06, 2008 9:11 pm

Place group of a card to a new card in a substack?

Post by 3d-swiss » Thu Apr 12, 2012 4:01 pm

Hello,

I tried to use the main stack for templates and put my data into a substack. How can I copy/place a group from a card in the main stack onto a new card?
"bkgMasterCard" is set to "Behave like Background"
I tried to use a button with that script:

Code: Select all

on mouseUp
   
   set the defaultStack to "Daten"  -- "Daten" is a SubStack of Stack "Test_DB_1"
   create card -- in SubStack "Daten"
   put it into tNewCard -- Remember the new card, for testing only
  
   set the defaultStack to "Test_DB_1" 
   place group "bkgMasterCard" of card "VorlageDaten" onto tNewCard -- Error. can't place group.
    
   go to it
   
end mouseUp
If it's not possible to do it my way: how can I use templates for a substack? (When I place my background on the first card of the substack, how can I hide this card of being seen i.e. when the user use next card/previous card to move for and back in the substack?)

Thanks for reading and help.
Jens

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Place group of a card to a new card in a substack?

Post by dunbarx » Thu Apr 12, 2012 5:30 pm

Use the "copy" command instead. "Place" is, I think, more suitable for use within a stack, taking advantage of backgroundbehavior.

Craig Newman

3d-swiss
Posts: 39
Joined: Thu Nov 06, 2008 9:11 pm

Re: Place group of a card to a new card in a substack?

Post by 3d-swiss » Thu Apr 12, 2012 7:03 pm

Hello Craig,

thanks for your input. It's perfect!
It works with that code:

Code: Select all

on mouseUp
   
   set the defaultStack to "Daten"  -- "Daten" is a SubStack of Stack "Test_DB_1"
   create card -- in SubStack "Daten"
   put it into tNewCard -- Remember the new card, for testing only
  
   set the defaultStack to "Test_DB_1" 
   copy group "bkgMasterCard" of card "VorlageDaten" to tNewCard -- instead of place 

   go to tNewCard
   
end mouseUp
Best regards
Jens

Post Reply