<doc>
  <legacy_id>1059</legacy_id>
  <name>mouseUp</name>
  <type>message</type>
  <syntax>
    <example>mouseUp <i>mouseButtonNumber</i></example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>User Interaction</category>
  </classification>
  <references>
    <function tag="mouseClick">mouseClick Function</function>
    <message tag="mouseUpInBackdrop">mouseUpInBackdrop Message</message>
    <command tag="click">click Command</command>
    <message tag="mouseStillDown">mouseStillDown Message</message>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Sent when the user releases the <glossary tag="mouse button">mouse button</glossary>.</summary>
  <examples>
    <example>on mouseUp</p><p>  answer "You clicked" &amp;&amp; the name of the target</p><p>end mouseUp</example>
  </examples>
  <description>
    <p>Handle the <b>mouseUp</b> <keyword tag="message box">message</keyword> to perform an action when the user releases the <glossary tag="mouse button">mouse button</glossary> after clicking.</p><p/><p><b>Parameters:</b></p><p>The <i>mouseButtonNumber</i> specifies which <glossary tag="mouse button">mouse button</glossary> was pressed:</p><p/><p>* 1 is the mouse button on Mac OS systems and the left button on Windows and Unix systems.</p><p>* 2 is the middle button on Unix systems.</p><p>* 3 is the right button on Windows and Unix systems and Control-click on Mac OS systems.</p><p/><p><b>Comments:</b></p><p>The <b>mouseUp</b> <keyword tag="message box">message</keyword> is sent to the <keyword tag="control">control</keyword> that was clicked, or to the <keyword tag="card">card</keyword> if no <keyword tag="control">control</keyword> was under the <glossary tag="mouse pointer">mouse pointer</glossary>.</p><p/><p>The <b>mouseUp</b> <keyword tag="message box">message</keyword> is sent only when the <glossary tag="Browse tool">Browse tool</glossary> is being used. If an <glossary tag="unlock">unlocked</glossary> <keyword tag="field">field</keyword> is clicked with <glossary tag="mouse button">mouse button</glossary> 1 or 2, no <b>mouseUp</b> <keyword tag="message box">message</keyword> is sent.</p><p/><p>If the mouse has moved outside the control that was originally clicked before the user releases the mouse button, the <b>mouseRelease</b> <keyword tag="message box">message</keyword> is sent instead of <b>mouseUp</b>. If the click is the second click of a double click, the <message tag="mouseDoubleUp">mouseDoubleUp</message> message is sent instead of <b>mouseUp</b>.</p><p/><p><code/><img src="202651"/> <b>Tip:</b><code/> If the user clicks several times in rapid succession (for example, if the user clicks an "Increase" button that increases a number by 1), some of the clicks may send a <message tag="mouseDoubleUp">mouseDoubleUp</message> <keyword tag="message box">message</keyword> instead of <b>mouseUp</b>. If your <property tag="script">script</property> only handles the <b>mouseUp</b> <keyword tag="message box">message</keyword>, these accidental double clicks will be lost. One way to prevent this is to install a <glossary tag="handler">handler</glossary> in an <glossary tag="object">object</glossary> that's further in the <glossary tag="message path">message path</glossary>, to re-send double clicks:</p><p/><p><code>  on mouseDoubleUp</code></p><p><code>    if "on mouseUp" is in the script of the target \</code></p><p><code>       and "on mouseDoubleUp" is not in the script of the target</code></p><p><code>    then send "mouseUp: to the target</code></p><p><code>  end mouseDoubleUp</code></p><p/><p>If the user double-clicks an object whose script contains a <b>mouseUp</b> <glossary tag="handler">handler</glossary> but no <message tag="mouseDoubleUp">mouseDoubleUp</message>, the above <glossary tag="handler">handler</glossary> will automatically send a <b>mouseUp</b> to the <glossary tag="object">object</glossary> so the second click can be handled normally (instead of as a double-click).</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> If the user clicks a transparent <glossary tag="pixel">pixel</glossary> in an <keyword tag="image">image</keyword>, the <b>mouseUp</b> <keyword tag="message box">message</keyword> is sent to the <glossary tag="object">object</glossary> behind the <keyword tag="image">image</keyword>, not to the <keyword tag="image">image</keyword>.</p>
  </description>
</doc>