custom buttons

Wouter wouter.abraham at pi.be
Thu Feb 26 08:40:15 EST 2004


On 26 Feb 2004, at 06:22, use-revolution-request at lists.runrev.com wrote:

> Message: 7
> Date: Wed, 25 Feb 2004 22:16:21 -0500
> From: Thomas McGrath III <3mcgrath at adelphia.net>
> Subject: Re: custom buttons
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <26F085DE-680A-11D8-95F7-000A95DA60FA at adelphia.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> My Bad,,,,,,
>
> I didn't include the images in that file.
>
> this one has it I swear....
>
> go URL "http://users.adelphia.net/~3mcgrath/Buttons.rev"
>
>
> Tom


Hi Tom,

Another possible buttonscript.

local lOldLoc   ### or make custom properties upPos and downPos
on mousedown
     put the loc of me into lOldLoc
     checkformousewithin
end mousedown

on checkformousewithin
   if the mouseloc is within the rect of btn "backbutton" then
       if the mouse is down then
         set the icon of btn "backbutton" to 1013  ### your buttondown 
img
         set the loc of me to (item 1 of lOldLoc + 5,item 2 of lOldLoc + 
5)
         send "checkformousewithin" to me in 20 millisecs
       else
         set the icon of btn "backbutton" to 1014  ### your buttonup img
         set the loc of me to  lOldLoc
       end if
     else
       if the mouse is down then
         set the icon of btn "backbutton" to 1014
         set the loc of me to  lOldLoc
         send "checkformousewithin" to me in 20 millisecs
       end if
     end if
end checkformousewithin

on mouseup
   answer "Yes"
end mouseup


Greetings,
WA



More information about the use-livecode mailing list