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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Akatz
Posts: 12
Joined: Mon Oct 31, 2011 1:28 pm

Substack

Post by Akatz »

Hi, I am creating a Spot the Difference game for my school project and I'm wondering is it possible to go from the main stack to substacks via buttons? For example, on the main stack there is a play button which when clicked, would go to a specific substack and so on. Thank you
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Substack

Post by Klaus »

Hi Akatz,

you already said it:

Code: Select all

on mouseup
  go stack "name of substack"
end mouseup
:D


Best

Klaus
Akatz
Posts: 12
Joined: Mon Oct 31, 2011 1:28 pm

Re: Substack

Post by Akatz »

Thanks a lot for the help :)
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Substack

Post by Klaus »

Hi Akatz,

check this "must see":
http://www.runrev.com/developers/lesson ... nferences/

And welcome to the forum! :D


Best

Klaus
Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Re: Substack

Post by Happyrever »

Just a point about opening and closing substacks.
I found that the substack needs to be closed properly when used in a standalone, because in my experience they continue to run in memory when the main application is ended.
I noticed this during development, there were many copies of the substack name in taskmanager and I found they needed to be terminated properly to get rid of them.
townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Substack

Post by townsend »

That's good to know. I usually just 'go' to another stack.

So how do you close them properly?
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3582
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Substack

Post by mwieder »

If you set the destroyStack property of a stack or substack to true then it will be removed from memory when the stack is closed. Otherwise it will stay in memory until you explicitly remove it. There's an option in LC preferences to do this for you automatically when you make a new stack/substack.

Also, if you have things like open sockets that you haven't closed, the stack will stay in memory until the open processes have been terminated properly.
Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Re: Substack

Post by Happyrever »

on closecard --This being the main stack card
close stack "Scratchpad" -- This being the substack
end closecard
Post Reply