Can you do it without the "when sprite clicked" block? If you have "if mouse down and touching mouse pointer", it's not exactly the same as the "when sprite clicked" block. I can click somewhere else on the stage, then touch the sprite with the mouse pointer and it will activate the script, but I don't want that. I want it so that you have to keep the mouse on the button while clicking!
Offline
just use a script like if (touching mouse AND mouse is clicked)
if this is not what you asked for, please explain better
Offline
Use two scripts:
[blocks]<when green flag clicked>
<forever>
<if><< << <mouse down?> <and> <touching[ mouse-pointer >> <and> <( <{ click }> <=> 1 )> >>
Insert whatever you want here
<end>
<end>
And the click script:
<when green flag clicked>
<set{ click }to( 0
<forever>
<wait until><mouse down?>
<set{ click }to( 1
<set{ click }to( 0
<wait until><< <not> <mouse down?> >>
<end>[/blocks]
I'm not sure if that will work, I usually don't test scripts I post on the forums... Still, you should try it
Offline
technoguyx wrote:
Use two scripts:
[blocks]<when green flag clicked>
<forever>
<if><< << <mouse down?> <and> <touching[ mouse-pointer >> <and> <( <{ click }> <=> 1 )> >>
Insert whatever you want here
<end>
<end>
And the click script:
<when green flag clicked>
<set{ click }to( 0
<forever>
<wait until><mouse down?>
<set{ click }to( 1
<set{ click }to( 0
<wait until><< <not> <mouse down?> >>
<end>[/blocks]
I'm not sure if that will work, I usually don't test scripts I post on the forums... Still, you should try it
yeah that will work. it will work better with a wait .01 seconds inbetween the set click to 1 set click to 2
Offline
Here is how I would do it:
[blocks]<when green flag clicked>
<forever if><< <touching[ mouse-pointer <and> <not> <mouse down?> >> >>
<wait( 0.01 )secsc>
<if><< <touching[ mouse-pointer <and> <mouse down?> >>
DO WHATEVER WHEN CLICKED
<end>
<end>[/blocks]
Offline
a better way
<when green flag clicked>
<forever>
<if><touching[ mouse pointer <and><not><mouse down?>
<wait until><mouse down?>
<SCRIPTS HERE>
Last edited by bhz (2009-03-08 07:54:43)
Offline