Creating Stack via script help?

Sarah Reichelt sarahr at genesearch.com.au
Sun Nov 21 19:10:34 EST 2004


On 20 Nov 2004, at 4:02 pm, J. Landman Gay wrote:

> I usually use "create card" rather than "clone". I suppose this is 
> personal preference, but it seems cleaner to me. A newly created card 
> will automatically include the background (provided the group's 
> backgroundBehavior is set to true,) so unless you need to copy over 
> specific card properties, "create" works fine. If you've set up a 
> bunch of card properties that you want to retain though, then cloning 
> is one way to carry them over and you could use that instead. Another 
> (possibly preferable) way to set up card properties is by setting 
> properties in the templatecard before creating new cards.
>
Using "create card" rather than clone can be really important if you 
are using groups. I recently rescued a stack for someone when it was 
taking about 7 seconds to go to the next card with no apparent messages 
in the way. The stack had over 400 cards and it was a data stack with 
each card containing the same objects. Although the objects were mostly 
in groups (2 groups per card) they were not set as background groups 
and the cards had all been made using the "clone" command.

The main effect of this was that there were over 800 separate groups in 
the message passing hierarchy which seemd to be what was delaying 
everything! The stack size was over 21 MB, loading & saving took for 
ever and it was really unresponsive.

By re-building the stack with just 3 background groups and using 
"create card" to make the cards, I got the stack size down to 1.9 MB 
(after importing all the data) and with the normal instant response 
times to clicks and arrow keys.

Cheers,
Sarah



More information about the use-livecode mailing list