timer/counter handlers at stack level

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
homer
Posts: 20
Joined: Fri Jun 29, 2007 6:44 pm

timer/counter handlers at stack level

Post by homer » Sat Aug 11, 2007 4:38 am

ok,

I have made progress.

can I put all my custom handlers in the stack script?

i thought i had to include custom handlers in the object i was using it in?

like

"button777"

on mouseUp
myHandler007
end mouse

on myHandler007
put "9" into fld "888"
end myHandler007

(end of button script)

so, if I put the "myHandler777" in the stack script, I can use it in any object script on any card? at any time?

if that's the case, why would anyone put a custom handler anywhere else?

thanks in advance

homer

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Aug 11, 2007 9:09 am

Hi Homer,

You put handlers higher up the message path of different objects send the same message and should execute the same script when the message is issued.

You put handlers into the object scripts if different objects send the same message and should execute different scripts when the message is issues.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sat Aug 11, 2007 11:37 am

Hi Homer,

I strongly advise to take a very deep look at all the stacks from the online scripting conference at RunRev:
http://downloads.runrev.com/section/scr ... rences.php
Especially the "Message Hierarchy" stack in your case.

And please spread the word :-)

These are invaluable resources for novice and experienced developers.


Best

Klaus

Post Reply