how can I stop a mouseenter-command

9 messages Options
Embed this post
Permalink
Reinhold Venzl-Schubert-2

how can I stop a mouseenter-command

Reply Threaded More More options
Print post
Permalink
Hi!

I have a lazy finger and don't want to click the mouse.
When the mouse enters a button on my card its script shall wait 1 second.
When meanwhile the mouse has leaved, the script shall stop.
Only when the mouse stays over the button the script shall work on.

Therefore my button has a script like this:

on mouseenter
  put "inside" into tMouseOut
   wait 1 second
   if tMouseOut is not "inside" then
      exit mouseenter
   else
      ## do anything important
   end if
end mouseenter

on mouseleave
   put empty into tMouseOut
end mouseleave

But my script works as well as the mouse stay over the button or leave it.
What is my mistake.

Thanks
Reinhold
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jan Schenkel

Re: how can I stop a mouseenter-command

Reply Threaded More More options
Print post
Permalink
Is your tMouseOut variable declared outside of the handlers? Otherwise, tMouseOut is just a separate variable in each handler's context.
Also, may I suggest renaming such script-local variables, starting with an 's' instead of a 't' - see also the Scripting Style Guide here: <http://www.fourthworld.com/embassy/articles/scriptstyle.html>
Of course, it's not mandatory, but it helps :-)

Jan Schenkel
=====
Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


--- On Fri, 11/13/09, Reinhold Venzl-Schubert <[hidden email]> wrote:

> From: Reinhold Venzl-Schubert <[hidden email]>
> Subject: how can I stop a mouseenter-command
> To: [hidden email]
> Date: Friday, November 13, 2009, 3:40 AM
> Hi!
>
> I have a lazy finger and don't want to click the mouse.
> When the mouse enters a button on my card its script shall
> wait 1 second.
> When meanwhile the mouse has leaved, the script shall
> stop.
> Only when the mouse stays over the button the script shall
> work on.
>
> Therefore my button has a script like this:
>
> on mouseenter
>   put "inside" into tMouseOut
>    wait 1 second
>    if tMouseOut is not "inside" then
>       exit mouseenter
>    else
>       ## do anything important
>    end if
> end mouseenter
>
> on mouseleave
>    put empty into tMouseOut
> end mouseleave
>
> But my script works as well as the mouse stay over the
> button or leave it.
> What is my mistake.
>
> Thanks
> Reinhold
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
dunbarx

Re: how can I stop a mouseenter-command

Reply Threaded More More options
Print post
Permalink
In reply to this post by Reinhold Venzl-Schubert-2
The variable issue suggested by Jan is likely your problem. But do you
think this is nicer?

on mouseEnter
   wait 1 second
   if the mouseLoc is within the rect of me then doYourStuff
end mouseEnter

Craig Newman
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Alex Tweedly

Re: how can I stop a mouseenter-command

Reply Threaded More More options
Print post
Permalink
In reply to this post by Reinhold Venzl-Schubert-2
As well as what Jan said about making tMouseout a global (or, better, a
script local) variable, you probably also need to change
  wait 1 second
to
   wait 1 second with messages

otherwise the mouseleave message won't be processed while you wait, and
therefore the variable won't be changed.

-- Alex.


Reinhold Venzl-Schubert wrote:

> Hi!
>
> I have a lazy finger and don't want to click the mouse.
> When the mouse enters a button on my card its script shall wait 1 second.
> When meanwhile the mouse has leaved, the script shall stop.
> Only when the mouse stays over the button the script shall work on.
>
> Therefore my button has a script like this:
>
> on mouseenter
>   put "inside" into tMouseOut
>    wait 1 second
>    if tMouseOut is not "inside" then
>       exit mouseenter
>    else
>       ## do anything important
>    end if
> end mouseenter
>
> on mouseleave
>    put empty into tMouseOut
> end mouseleave
>
> But my script works as well as the mouse stay over the button or leave it.
> What is my mistake.
>
> Thanks
> Reinhold
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>  

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Alex Tweedly

Re: how can I stop a mouseenter-command

Reply Threaded More More options
Print post
Permalink
In reply to this post by dunbarx
[hidden email] wrote:
> The variable issue suggested by Jan is likely your problem. But do you
> think this is nicer?
>
> on mouseEnter
>    wait 1 second
>    if the mouseLoc is within the rect of me then doYourStuff
> end mouseEnter
>  
But beware that this will wrongly fire if you pass the mouse through a
button, i.e. enter the button, leave it and re-enter it before one
second later.

Of course, the wait with messages using a simple boolean value such as
tMouseOut has similar, though more subtle, failure modes; e.g. if you
enter, then leave and then re-enter the button within the one second
interval of the "wait with messages".

I was going to suggest an alternative (keeping track of "the millisecs")
but when I tested it, I found that I did not reliably get the
'mouseleave' messages if I enter + leave + enter within a short time
period. (This was detectable using both my on code and using the message
watcher).  So I'd recommend first testing that you do get these messages
reliably (maybe it's just me), and/or checking in the bug database to
see if there's any known problem with these messages.

-- alex.
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
dunbarx

Re: how can I stop a mouseenter-command

Reply Threaded More More options
Print post
Permalink
In reply to this post by Reinhold Venzl-Schubert-2
Alex.

If you leave the button too soon nothing happens. Of course, if you zoom in
and out, like you say, well, I was able to invoke four "doStuffs" in a row.

Shows how important testing even simple ideas really is.

Craig.

In a message dated 11/13/09 6:31:17 PM, [hidden email] writes:


> > on mouseEnter
> >    wait 1 second
> >    if the mouseLoc is within the rect of me then doYourStuff
> > end mouseEnter
> >  
> But beware that this will wrongly fire if you pass the mouse through a
> button, i.e. enter the button, leave it and re-enter it before one
> second later.
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Rick Rice

folders in revlet

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alex Tweedly

Just for the heck of it I decided to have a look at Revolution Media  
4.0.0. To this point I have been using Revolution 2.6.1.
The ability to save your stack for the web blew me away. Only one  
problem, I store hundreds of images in separate folders and call them  
into the stack as I need them. This doesn't work in the revlet. I  
imagine many on this list have solved this problem. Could someone  
post the appropriate script so that the revlet can access images  
stored in separate folders.
Thanks
Rick

The way I do it now is:
first I find the folder with the images

on gettheImageList
   global stackaddress, stackpath
   put the filename of this stack into stackpath
   set itemdel to "/"
   If (IsOSX()) then  -- to get Mac path
     get offset(".app/Contents/MacOS/", stackpath)
     if it > 0 then -- 2.4.3 or later
       delete char it to len(stackpath) of stackpath
     end if
   end if
   delete the last item of stackpath
   put stackpath into stackaddress
   put "/urinalysisTestImages" after stackaddress
end gettheImageList

Then I pick an image put it into gSlide and display it like this:

on displayimage
   global gSlide, stackaddress, correctanswer
   put stackaddress & gSlide into gSlide
   set the filename of image 1 to gSlide
   show image 1
end displayimage

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richard Miller-5

Re: folders in revlet

Reply Threaded More More options
Print post
Permalink
Just change this line:

    set the filename of image 1 to gSlide

to this:

    put url ("binfile:" & gSlide) into image 1

It's the way it has to be for revlets.

Richard Miller



Rick Rice wrote:

>
> Just for the heck of it I decided to have a look at Revolution Media
> 4.0.0. To this point I have been using Revolution 2.6.1.
> The ability to save your stack for the web blew me away. Only one
> problem, I store hundreds of images in separate folders and call them
> into the stack as I need them. This doesn't work in the revlet. I
> imagine many on this list have solved this problem. Could someone post
> the appropriate script so that the revlet can access images stored in
> separate folders.
> Thanks
> Rick
>
> The way I do it now is:
> first I find the folder with the images
>
> on gettheImageList
>   global stackaddress, stackpath
>   put the filename of this stack into stackpath
>   set itemdel to "/"
>   If (IsOSX()) then  -- to get Mac path
>     get offset(".app/Contents/MacOS/", stackpath)
>     if it > 0 then -- 2.4.3 or later
>       delete char it to len(stackpath) of stackpath
>     end if
>   end if
>   delete the last item of stackpath
>   put stackpath into stackaddress
>   put "/urinalysisTestImages" after stackaddress
> end gettheImageList
>
> Then I pick an image put it into gSlide and display it like this:
>
> on displayimage
>   global gSlide, stackaddress, correctanswer
>   put stackaddress & gSlide into gSlide
>   set the filename of image 1 to gSlide
>   show image 1
> end displayimage
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Rick Rice

Re: folders in revlet

Reply Threaded More More options
Print post
Permalink
Thanks Richard.
Will do.
Rick

----- Original Message -----
From: Richard Miller <[hidden email]>
Date: Friday, November 13, 2009 4:32 pm
Subject: Re: folders in revlet
To: How to use Revolution <[hidden email]>

> Just change this line:
>
>     set the filename of image 1 to gSlide
>
> to this:
>
>     put url ("binfile:" & gSlide) into image 1
>
> It's the way it has to be for revlets.
>
> Richard Miller
>
>
>
> Rick Rice wrote:
> >
> > Just for the heck of it I decided to have a look at Revolution
> Media
> > 4.0.0. To this point I have been using Revolution 2.6.1.
> > The ability to save your stack for the web blew me away. Only
> one
> > problem, I store hundreds of images in separate folders and
> call them
> > into the stack as I need them. This doesn't work in the
> revlet. I
> > imagine many on this list have solved this problem. Could
> someone post
> > the appropriate script so that the revlet can access images
> stored in
> > separate folders.
> > Thanks
> > Rick
> >
> > The way I do it now is:
> > first I find the folder with the images
> >
> > on gettheImageList
> >   global stackaddress, stackpath
> >   put the filename of this stack into stackpath
> >   set itemdel to "/"
> >   If (IsOSX()) then  -- to get Mac path
> >     get offset(".app/Contents/MacOS/",
> stackpath)>     if it > 0 then -- 2.4.3 or later
> >       delete char it to
> len(stackpath) of stackpath
> >     end if
> >   end if
> >   delete the last item of stackpath
> >   put stackpath into stackaddress
> >   put "/urinalysisTestImages" after stackaddress
> > end gettheImageList
> >
> > Then I pick an image put it into gSlide and display it like this:
> >
> > on displayimage
> >   global gSlide, stackaddress, correctanswer
> >   put stackaddress & gSlide into gSlide
> >   set the filename of image 1 to gSlide
> >   show image 1
> > end displayimage
> >
> > _______________________________________________
> > use-revolution mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage
> your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution