0 Replies Latest reply on Jan 29, 2012 12:30 PM by kahsbnxasxwasx

    HI .MASTER Help me see a problem? I am anxious FlowElementMouseEvent.originalEvent.stopPropagation()

    kahsbnxasxwasx Level 1

      public static function linkShowPrivate(e:FlowElementMouseEvent):void{

         e.originalEvent.stopPropagation();

       

       

      But still bubbling to the STAGE, I am extremely anxious, ask how to do

       

       

      I use the most simple example of this reduction

      <?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/mx" minWidth="955" minHeight="600" creationComplete="application1_creationCompleteHandler(event)"

            click="Alert.show('a')">

       

      <fx:Script>

        <![CDATA[

         import flashx.textLayout.elements.LinkElement;

         import flashx.textLayout.elements.ParagraphElement;

         import flashx.textLayout.elements.SpanElement;

         import flashx.textLayout.events.FlowElementMouseEvent;

        

         import mx.controls.Alert;

         import mx.events.FlexEvent;

         protected function button1_clickHandler(event:MouseEvent):void

         {

          // TODO Auto-generated method stub

         }

         public  function linkShowPrivate(e:FlowElementMouseEvent):void{

          e.stopPropagation();

          e.originalEvent.stopPropagation();

          trace("a");

         }

        

         protected function application1_creationCompleteHandler(event:FlexEvent):void

         {

          // TODO Auto-generated method stub

         

         

          var pClick:ParagraphElement=new ParagraphElement();

          var link:LinkElement=new LinkElement();

          var linkSpanName:SpanElement=new SpanElement();//link元素的名字

          linkSpanName.text="asxasxasxasxasxasx";

          link.addChild(linkSpanName);

          link.addEventListener(FlowElementMouseEvent.CLICK,linkShowPrivate);

          pClick.addChild(link);

          t1.textFlow.addChild(pClick);

         }

        

       

        ]]>

      </fx:Script>

       

      <fx:Declarations>

      </fx:Declarations>

      <s:TextArea id="t1" x="184" y="136" editable="false"/>

      </s:Application>

       

       

      THE 'a' will alert when I click the link .BUT I Prevent bubbling of the