<doc>
  <legacy_id>1246</legacy_id>
  <name>target</name>
  <type>function</type>
  <syntax>
    <example>the target</example>
    <example>target()</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Objects &amp; Messages</category>
  </classification>
  <references>
    <function tag="dragSource">dragSource Function</function>
    <function tag="dragDestination">dragDestination Function</function>
    <keyword tag="me">me Keyword</keyword>
    <function tag="selectedObject">selectedObject Function</function>
    <keyword tag="target">target Keyword</keyword>
    <property tag="text">text Property</property>
  </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><glossary tag="return">Returns</glossary> the <glossary tag="object">object</glossary> which received the <keyword tag="message box">message</keyword> that started <glossary tag="execute">execution</glossary>.</summary>
  <examples>
    <example>the target</example>
    <example>if word 1 of the target is "button" then clickedAButton</example>
    <example>set the backgroundColor of the target to "black"</example>
  </examples>
  <description>
    <p>Use the <b>target</b> <control_st tag="function">function</control_st> within a message <glossary tag="handler">handler</glossary> to determine which <glossary tag="object">object</glossary> originally received the <keyword tag="message box">message</keyword>.</p><p/><p><b>Value:</b></p><p>The <b>target</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the <property tag="name">name</property> <glossary tag="property">property</glossary> of the <glossary tag="object">object</glossary>.</p><p/><p><b>Comments:</b></p><p>Suppose a card script contains a <b>mouseDown</b> <glossary tag="handler">handler</glossary>. If the user clicks a <keyword tag="button">button</keyword>, a <message tag="mouseDown">mouseDown</message> <keyword tag="message box">message</keyword> is sent to the <keyword tag="button">button</keyword>. If the <glossary tag="button">button's</glossary> <property tag="script">script</property> does not contain a <message tag="mouseDown">mouseDown</message> <glossary tag="handler">handler</glossary>, the <keyword tag="message box">message</keyword> is <glossary tag="pass">passed</glossary> to the <keyword tag="card">card</keyword>, and <glossary tag="handle">handled</glossary> by the <glossary tag="card">card's</glossary> <message tag="mouseDown">mouseDown</message> <glossary tag="handler">handler</glossary>.</p><p/><p>The <b>target</b> <control_st tag="function">function</control_st> is similar to the <keyword tag="me">me</keyword> <glossary tag="keyword">keyword</glossary>. In the example described above, within the <glossary tag="card">card's</glossary> <glossary tag="handler">handler</glossary>, the <b>target</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the <glossary tag="button">button's</glossary> name, because the <keyword tag="button">button</keyword> is the <glossary tag="object">object</glossary> that first received the <message tag="mouseDown">mouseDown</message> <keyword tag="message box">message</keyword>. However, the <keyword tag="me">me</keyword> <glossary tag="keyword">keyword</glossary> is a <href tag="reference/object_reference.rev">reference</href> to the <keyword tag="card">card</keyword>, because the <keyword tag="card">card</keyword> is the <glossary tag="object">object</glossary> whose <property tag="script">script</property> contains the <message tag="mouseDown">mouseDown</message> <glossary tag="handler">handler</glossary> that is <glossary tag="execute">executing</glossary>.</p>
  </description>
</doc>