4 Replies Latest reply on Jan 4, 2011 6:20 AM by nikos101

    Button click is sometimes called twice :(

    nikos101 Level 2

      I'm using sdk 4.1 and have a situation where a  button click is sometimes called twice .

       

      Is this a bug?

       

      I use    trace('fired'); to confirm

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Panel xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" title="Add a Comment"   implements="views.interfaces.IWiseView">
          <s:layout>
              <s:VerticalLayout horizontalAlign="right" />
          </s:layout>
         
          <fx:Script>
              <![CDATA[

       

                 
                  import mx.events.FlexEvent;
                 
                  import org.osflash.signals.Signal;
                 
                  public var signal:Signal = new Signal(String);;
                 
                 
                  public function onLogout():void{
                     
                      ta.text = '';
                     
                  }
                 
             
                  protected function addCommentBtn_clickHandler(event:MouseEvent):void
                  {
                      signal.dispatch(ta.text);
                      trace('fired');
                  }
              ]]>
          </fx:Script>
         
         
          <s:TextArea width="100%" height="160" id="ta"/>
          <s:Button label="Add comment" id="addCommentBtn" click="addCommentBtn_clickHandler(event)" />
        
         
      </s:Panel>