Page 1 of 1

Substack

Posted: Mon Oct 31, 2011 1:39 pm
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

Re: Substack

Posted: Mon Oct 31, 2011 1:58 pm
by Klaus
Hi Akatz,

you already said it:

Code: Select all

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


Best

Klaus

Re: Substack

Posted: Thu Nov 03, 2011 11:32 am
by Akatz
Thanks a lot for the help :)

Re: Substack

Posted: Thu Nov 03, 2011 6:17 pm
by Klaus
Hi Akatz,

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

And welcome to the forum! :D


Best

Klaus

Re: Substack

Posted: Thu Nov 03, 2011 6:54 pm
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.

Re: Substack

Posted: Thu Nov 03, 2011 7:09 pm
by townsend
That's good to know. I usually just 'go' to another stack.

So how do you close them properly?

Re: Substack

Posted: Thu Nov 03, 2011 7:21 pm
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.

Re: Substack

Posted: Thu Nov 03, 2011 7:30 pm
by Happyrever
on closecard --This being the main stack card
close stack "Scratchpad" -- This being the substack
end closecard