On moveobj
move image "grabber.gif" to the points of graphic ("Path"&random(4)) in 3 seconds
send "moveobj" to me in 3.1 seconds
add 1 to field "score"
if field "score" >= 10 then
go to next card
end if
end moveobj
The code works great to move me to the new page but it does so before ending the moveobj. This results in moveobj continuing to execute on the next card. How do I stop it? Can I do it on this script or on opencard on the next card?
How do I stop this thing???
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: How do I stop this thing???
Hi Peacfulrvr,
nit sure, what logic you are looking for, but maybe this is what you want:
Best
Klaus
nit sure, what logic you are looking for, but maybe this is what you want:
Code: Select all
On moveobj
move image "grabber.gif" to the points of graphic ("Path"&random(4)) in 3 seconds
## send "moveobj" to me in 3.1 seconds
add 1 to field "score"
if field "score" >= 10 then
go to next card
else
send "moveobj" to me in 3.1 seconds
end if
end moveobj
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: How do I stop this thing???
Your handler calls itself, so as long as it's able to run it will.
If you want the handler to stop based on some condition, you'll want to add that condition to the code to determine when to call itself, or stop calling itself.
If you want the handler to stop based on some condition, you'll want to add that condition to the code to determine when to call itself, or stop calling itself.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 34
- Joined: Mon Nov 03, 2014 7:11 pm
Re: How do I stop this thing???
I am watching a video that I think shows how to put true into a variable and then change the variable based on a condition. I think I can figure it out... we shall see. I have not coded in like 15 years so this is interesting to learn. It has become a much needed hobby. And my students at school enjoy testing my game.