calling handlers/scripts from one stack to the other

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

calling handlers/scripts from one stack to the other

Post by no1g8tor » Fri Dec 14, 2007 5:15 pm

I am learning RunRev quickly, but I ran into a road block.

I have several stacks as part of my project and when its finished only the main stacks cards or "windows" will be dispalyed and the other stacks will just hold data and scripts.

My question is. How can I call a script or handler on a card script from another stack from the main stack.

Example of what I tried and no luck...

I put a button on my main stack that opened up the sub-stack and went to the card I needed and then I put in the name of the handler on the card script, but I get "Cant find Handler" error.

Also, If I do have to open the card and stack, I don't want to be able to see the card, Only the main stack.

Thanks so much in advance

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Sat Dec 15, 2007 12:00 am

Hi no1g8tor,

quite a few options here. :)

Look up send and call in the dictionary. You might also want to make your stck a library or backscript.

examples:

send "myMessage" to cd "myCard" of stack "mySubstack"
-- sends a meesage to that card

start using stack "mySubstack2"
-- the stackscript of the substack is inserted into the messagepath and all scripts contained in the substacks stack script are available

put the script of button "myButton" of stack "mySubstack3" into back
-- almost the same as start using, but for any control, card or stack

Hope that helps,

Malte

Post Reply