2 Replies Latest reply on Dec 18, 2006 6:09 PM by raid01

    why event not captured by mxml components

    raid01
      Hi everyone,

      i've test2.mxml as below, would anyone tell me why the event cannot be captured by mxml components ?

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

      <mx:Application xmlns:mx=" http://www.macromedia.com/2003/mxml"
      creationComplete="initThis();" xmlns:gp="*">
      <mx:Script>
      <![CDATA[
      function initThis() {
      addEventListener("myEvent",tt);
      }
      function tt(){
      t1.text = "updated by tt";
      }
      ]]>
      </mx:Script>

      <mx:TextInput id="t1"/>
      <mx:ComboBox id="t2" dataProvider="{['aa','bb']}"
      change="dispatchEvent({type:'myEvent'});"/>
      <gp:test3/>
      </mx:Application>

      and a mxml components test3.mxml

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

      <mx:VBox xmlns:mx=" http://www.macromedia.com/2003/mxml" xmlns:gp="*"
      creationComplete="initThis();">
      <mx:Script>
      <![CDATA[

      function initThis(){
      t3.text = 'ini';
      addEventListener("myEvent",updateT3);
      }

      function updateT3(){
      t3.text = 't3 updated';
      }
      ]]>
      </mx:Script>

      <mx:TextInput id="t3"/>
      </mx:VBox>

      thanks in advance !