<doc>
  <legacy_id>1515</legacy_id>
  <name>within</name>
  <type>function</type>
  <syntax>
    <example>within(<i>object</i>,<i>point</i>)</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Appearance &amp; Positioning</category>
  </classification>
  <references>
    <function tag="intersect">intersect Function</function>
    <operator tag="is within">is within Operator</operator>
    <function tag="mouseControl">mouseControl Function</function>
    <operator tag="is not within">is not within Operator</operator>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>
    <p><glossary tag="return">Returns</glossary> true if a <keyword tag="point">point</keyword> is within an <glossary tag="object">object</glossary>, false if not.</p>
  </summary>
  <examples>
    <example>within(scrollbar ID 3,"33,40")</example>
    <example>within(field "News Items",the clickLoc)</example>
  </examples>
  <description>
    <p>Use the <b>within</b> function to determine whether a <keyword tag="point">point</keyword> is inside the specified <glossary tag="object">object</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>object</i> is any <href tag="reference/object_reference.rev">object reference</href>.</p><p/><p>The <i>point</i> is any <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <keyword tag="point">point</keyword>--a vertical and horizontal distance from the top left of the <glossary tag="current stack">current stack</glossary>, separated by a comma. (If the <i>object</i> is a <object tag="stack">stack</object>, the distance is from the top left of the screen.)</p><p/><p><b>Value:</b></p><p>The <b>within</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> <code>true</code> or <code>false</code>.</p><p/><p><b>Comments:</b></p><p>If the <i>point</i> is within the clickable area of the <i>object</i>, the <b>within</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> true, even if another <glossary tag="object">object</glossary> is layered on top of the <i>object</i>.</p><p/><p>If the <i>object</i> is a <keyword tag="graphic">graphic</keyword>, its interior is considered to be within the <keyword tag="graphic">graphic</keyword> only if the <glossary tag="graphic">graphic's</glossary> <property tag="filled">filled</property> <glossary tag="property">property</glossary> is true or the <keyword tag="graphic">graphic</keyword> is <property tag="selected">selected</property>.</p><p/><p>If the <i>object</i> is an <keyword tag="image">image</keyword>, only <property tag="pixels">pixels</property> that contain paint are considered to be within the <keyword tag="image">image</keyword>. Transparent parts of the <keyword tag="image">image</keyword> are not within the <keyword tag="image">image</keyword>, although they are within the <glossary tag="image">image's</glossary> <keyword tag="rectangle">rectangle</keyword>.</p><p/><p>If the <i>object</i> is a <keyword tag="button">button</keyword> whose <property tag="menuMode">menuMode</property> is "tabbed", only the tabs are considered to be within the button. The area below the tabs is not within the <keyword tag="button">button</keyword>, although it is within the <glossary tag="button">button's</glossary> <keyword tag="rectangle">rectangle</keyword>.</p><p/><p>If the <i>object</i> is a <object tag="stack">stack</object>, the <b>within</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> true if the <keyword tag="point">point</keyword> is in the <glossary tag="stack">stack's</glossary> content area, and false if the <keyword tag="point">point</keyword> is in the <glossary tag="stack">stack's</glossary> <glossary tag="title bar">title bar</glossary> or borders.</p><p/><p>The expression</p><p><code><i>point</i> is within the rect of <i>object</i></code></p><p>is equivalent <code>to</code></p><p><code/>  within(<i>object</i>,<i>point</i>)</p><p>unless the <i>object</i><a/> is a graphic or image, or a tabbed button.</p>
  </description>
</doc>