1 Reply Latest reply on Oct 22, 2009 9:18 PM by Roland Tritsch

    How to get a click event on a Path?

    Roland Tritsch Level 1

      hi all,

       

      I am using Flash Builder 4 Beta 2.

       

      I need to get a click event on a Path object. The source code below displays a red triangle.

      Obviously, if I define a click="" on the Graphics object the entire Graphics Area becomes "clickable".

      That is not what I want. I just want the triangle to become "clickable"?

       

      Any ideas, how to make that happen?

       

      Regards ...

          Roland

       

      ---

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768"

      >

      <s:Panel title="Roland's FXG Example">

      <s:Group>

      <s:Graphic buttonMode="true" click="trace('ok')">

      <s:Path data="M 100 100 L 100 300 L 300 100 L 100 100">

      <!--

      <s:Path>

      <s:segments>

      <s:MoveSegment x="100" y="100"/>

      <s:LineSegment x="100" y="300"/>

      <s:LineSegment x="300" y="100"/>

      <s:LineSegment x="100" y="100"/>

      </s:segments>

      -->

      <s:stroke>

      <s:Stroke color="black" weight="10"/>

      </s:stroke>

      <s:fill>

      <s:SolidColor color="red"/>

      </s:fill>

      </s:Path>

      </s:Graphic>

      </s:Group>

      </s:Panel>

      </s:Application>