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!
Bruce
Handler won't run
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9656
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Handler won't run
Hi.
Does the handler in the card script fire from the message box?
Otherwise, something is amiss. If you have in a button:
And in the cards script:
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 emoticons.
Craig Newman
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
doThis
end mouseUp
Code: Select all
on doThis
answer "Bingo"
end doThis
Does that one fire? We will fix this, never fear. I bet 50 ticks it will engender one of those emoticons.
Craig Newman
Re: Handler won't run
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
Bruce
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
Bruce
-
- VIP Livecode Opensource Backer
- Posts: 9656
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Handler won't run
Ah.
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.
Craig
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.
Craig
Re: Handler won't run
Put it on my credit card.