Side-Scrollers / Drag-n-Drop
Brian Yennie
briany at qldlearning.com
Wed Jul 26 05:56:04 EDT 2006
Richmond,
You have a couple of options (at least):
1) Break up your infinite repeat loop, and instead use "send ... in"
messages to do periodic polling. As in:
on openCard
repeat until A=2
doSomething
end repeat
end openCard
Becomes:
on openCard
doSomethingRepeated
end openCard
on doSomethingRepeated
doSomething
if (A=2) then return
else send "doSomethingRepeated" to this card in 10 milliseconds
end doSomethingRepeated
2) Another option is to look into using "wait ... with messages" inside
your repeat loop. That would allow you to receive the mouseUp /
mouseDown events, and from those handlers set a global flag to break
out of the loop if necessary. Something like:
global AFlag
on openCard
repeat until AFlag=2
doSomething
wait 1 milliseconds with messages
end repeat
end openCard
on mouseDown
if somethingHappened() then
put 2 into AFlag
end if
end mouseDown
Hope that helps.
- Brian
> the PROBLEM here is that even if the image is within the
> field "CollectingCentre" it will not stay there because
> the openCard script is still running.
>
> Would be very grateful if someone could tell me how to get the openCard
> script to stop running.
>
> sincerely, Richmond Mathewson
>
>
> ____________________________________________________________
>
> "Philosophical problems are confusions arising owing to the fluidity
> of meanings users attach to words and phrases."
> Mathewson, 2006
> ____________________________________________________________
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
More information about the use-livecode
mailing list