Page 1 of 1

Handler won't run

Posted: Fri Mar 25, 2016 5:49 am
by bd525
In the "on mouseUp" handler of a button I have a line that consists of the name of another handler. The handler by that name is in the script of the card on which the button resides. The handler in the card script is properly named and formatted. It starts with "on handlerName" and ends with "end handlerName". When I run the stack and click the button I get an error message that includes "(Handler: can't find handler)". I am a beginner, but I believe I understand the message path. A handler call from a button would go immediately to the card script; right?

I assume this simple question may be answered somewhere on the forum, but I cannot search for a string such as "can't find handler". The forum search function only searches for individual words, so when I search "can't find handler" (in the quotes) I get a list of all 6,000 or so posts that include the word "handler" and I don't relish searching all of those. Why is that? Seems like such a simple need; to search for a text string that includes more than one word, yet it appears that cannot be done.

Any assistance is appreciated. Thanks!


Re: Handler won't run

Posted: Fri Mar 25, 2016 6:29 am
by dunbarx

Does the handler in the card script fire from the message box?

Otherwise, something is amiss. If you have in a button:

Code: Select all

on mouseUp
end mouseUp
And in the cards script:

Code: Select all

on doThis
answer "Bingo"
end doThis
It ought to give you a dialog. Sure of your spelling? Try another handler call right above the one that throws the error, (make sure to put the handler in the card script)

Does that one fire? We will fix this, never fear. I bet 50 ticks it will engender one of those :oops: emoticons.

Craig Newman

Re: Handler won't run

Posted: Fri Mar 25, 2016 2:30 pm
by bd525
The problem was that I didn't know about the Apply button in script windows. I'm migrating from Director, which shows script errors automatically. Another handler in the card script prior to the handler in question had a missing "then" in an "else" keyword line. I noticed the Apply button, clicked it, and the error showed. Fixing that error fixed my problem.

Thanks for the quick reply, Craig! It's reassuring to know that the forum is monitored well, and that assistance comes in timely fashion.

So, I suppose yes, a qualified :oops:


Re: Handler won't run

Posted: Fri Mar 25, 2016 3:08 pm
by dunbarx

The script editor will in certain instances show an error before it is compiled (before applying). I am not sure how egregious these might need to be, and they occur only in certain constructions.

Anyway, you owe me 50 ticks.


Re: Handler won't run

Posted: Fri Mar 25, 2016 3:26 pm
by bd525
Put it on my credit card.