This content has been marked as final. Show 4 replies
The normal user interaction method for selecting something is to use a
mouse click event. Mouse enter is used to show the user that something
is selectable. Mouse down is used to show that the rolled over item is
active, and mouse up is used to register that selection. Using mouse up
allows the user to drag off the item and de-select it.
Are you working on a game where you want to add an element of surprise?
Adobe Community Expert
The ugly way is to do the following
on MouseEnter me
targetMS = the milliseconds + 500 -- delay of 1/2 second
repeat while the milliseconds < targetMS
go to frame 3
This would probably be ok but in general I avoid this because it ties up the
processor and will halt video or other actions in your project.
A better way is...
on beginSprite me
pTargetMS = 0
on mouseEnter me
pTargetMS = the milliseconds + 500 -- again, 1/2 second delay
on exitFrame me
if pTargetMS <> 0 then
if the milliseconds > pTargetMS then
go to frame 3
But one doesn't typically see navigation code in a mouseEnter handler but
that's a choice.
Word of Mouth Productions
"JustJc51" <email@example.com> wrote in message
>I have made a little experiment, navigating using the mouseEnter command,
> have found that this makes the navigation a bit to fast and easy to make
> mistakes in. So I was wondering if someone could help me with a script
> requiers the user to stay on the button for a ½ second before it reacts.
> Current Lingo is the simple
> on mouseEnter
> go to frame 3
> Thanks in advance!
Thank you for the good and quick answers!
The use is that I am writing a project, on the subject of interface design, asking if the usual click method allways is the best way or just the usual way. The reason for the request of a delay was that I found it impossible to avoid activating the buttons I hit by mistake. The ½ second comes from the popular belief that that is the reactiontime of an averange human, and that I figured that it would be easy to change, to a larger amount of time, if I found I needed more time. If I have to dismiss a point to activate interface I at least have to give it a fair chance.
Once again thank for the help!
Upon trying out the scripts, in one of my interfaces, I found that the solution offered just delays the time from the button has been touched till action is taken.
What I need is a script that says, if mouse enters for more than 500ms then start action. Anyone who can help me with that one?
How about something like this. It's very similar to Craig's code, but I think his slightly missed one point - which was that if the user moves the mouse back out of the sprite within 500ms, the action should not be performed.
The 'doneAction' variable is used to make sure the action is only performed once.
This is a behaviour script, so to use it you need to create a new behaviour, paste in the code, then place that behaviour onto a sprite. (note, this is not the same as putting code onto a cast member in the cast!).
hope this helps!