I'm guessing that:
1) You have a number of frames in a row that you want the child to see
2) That you have sprite with the arrow stretched across all the frames.
3) That you have this behavior attached to the whole span.
Assuming all this, then it sounds like you need some type of a time
out. That is, an amount of time after each click on the arrow, when
another click should be ignored. Here's an untested email Lingo
approach. This will lock out extra clicks on the arrow button for a
second after each click:
property pbAvailable
property pmsTimeoutAmount
property pmsReady
on beginSprite me
pbAvailable = TRUE -- allow first click, set to FALSE if you want
the user to have to wait first time.
pmsTimeoutAmount = 1000 -- whatever you think is right. This is a
one second timeout
end
on mouseDown me
if not(pbAvailable) then -- not available, ignore the mouseClick
return
end if
repeat while the mouseDown
end repeat
pbAvailable = FALSE -- make the arrow unavailable
pmsReady = the milliseconds + pmsTimeoutAmount
go to the frame + 1
end
on exitFrame me
if pbAvailable then -- nothing to do here
return
end if
if the milliseconds > pmsReady then
pbAvailable = TRUE -- time's up, make the arrow available now
end if
end
Two things to add:
1) If you use something like this, you may want to change the arrow
graphic to a grayed out version while the button is not available,
and back to the normal state when it becomes available again.
2) The repeat loop in your mouseDown has two problems. First, it
disallows any background activity (if you have anything like an
animation going on, it will stop). Second, it will activate even if
the user clicks down on your arrow, and then rolls off.
Hope this helps,
Irv
At 8:23 PM +0200 10/6/05, Michael Nadel wrote:
I have a simple behavior on an arrow that the child needs to click
to go to the frame + 1.
It says:
on mouseDown me
repeat while the mouseDown
end repeat
go to the frame + 1
end
But if the child clicks the arrow let's say 10 times in a row, it
will continue going from frame to frame for ten frames. Is there a
way to stop after one frame, even if the child clicked 10 times?
Thanks!
Michael Nadel
MediArt.Corp
"Creativity is more powerful than knowledge" -- Albert Einstein
***********************************************************************
Tel: (972-2) 5807-454
Email: [EMAIL PROTECTED]
Web: http://www.mediarthome.com
[To remove yourself from this list, or to change to digest mode, go
to http://www.penworks.com/lingo-l.cgi To post messages to the
list, email [email protected] (Problems, email
[EMAIL PROTECTED]). Lingo-L is for learning and helping with
programming Lingo. Thanks!]
--
Multimedia Wrangler.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]