mouseUp mouseButtonNumber

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller

Post Reply
DavJans
Posts: 219
Joined: Thu Dec 12, 2013 4:21 pm
Location: Spokane, WA USA

mouseUp mouseButtonNumber

Post by DavJans » Fri Sep 21, 2018 12:26 am

mouseUp3 -lets me save but doesn't work
mouseUp 3 - gives Not a valid parameter name message
mouseUp mouseButtonNumber 3 - gives Not a valid parameter name message

I don't understand what the syntax is supposed to look like and the dictionary doesn't have an example for me to steal.

Thank you.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm"

ClipArtGuy
Posts: 205
Joined: Wed Aug 19, 2015 4:29 pm

Re: mouseUp mouseButtonNumber

Post by ClipArtGuy » Fri Sep 21, 2018 2:05 am

I think this is what you are looking for?

Code: Select all

on mouseup pBtn
   if pBtn is 3 then
     do stuff
   end if
end mouseup
a switch/case might work better, depending on your needs...

Code: Select all

on mouseup pBtn
   switch pBtn
      case 1 
         --do mouse button 1 stuff
         break
      case 2 
         --do mouse button 2 stuff
         break
      case 3
         --do mouse button 3 stuff
         break
   end switch
end mouseup

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5572
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: mouseUp mouseButtonNumber

Post by dunbarx » Fri Sep 21, 2018 4:58 am

Hi.

ClipArtGuy has nailed it. Practice. practice...

I am only posting because you said:
mouseUp 3 - gives Not a valid parameter name message
Of the three code lines you gave, this one is syntactically correct. I just want you to find out why it fails.
This works just fine in a button script:

Code: Select all

on mouseup x
   if x = 1 then answer 1
   else if x = 3 then answer 3
end mouseup
Craig Newman

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”