Sending mouseUp

Mark Wieder mwieder at ahsoftware.net
Tue Mar 19 23:46:55 CDT 2013


Pete-

Tuesday, March 19, 2013, 6:47:33 PM, Craig wrote:

> Something like this has come up before. I remember that
> "preOpenCard" is invoked before the card (and the stack?) is even
> loaded into memory. I think. So there may be no valid target handler
> yet available to access. Why the "handled" value is set is odd, for
> sure, but I bet the answer is tangled up with the fact that these
> events are happening just a tad too early, before things have
> settled down.

Yep. Why are you trying to call a mouseUp handler on preOpenCard
anyway? Take the code in mouseUp, put it in its own handler, and call
it from mouseUp. Then call the same thing from preOpenCard.

-- in button script
on mouseUp
  doTheStuffThatUsedToBeHere
end mouseUp

on doTheStuffThatUsedToBeHere
  stuffThatUsedToBeHere
end doTheStuffThatUsedToBeHere

-- in card script
on preOpenCard
  dispatch "stuffThatUsedToBeHere" to button "yaddayadda"
end preOpenCard

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list