3 Replies Latest reply on Aug 5, 2010 5:20 PM by Flex harUI

    why doesn't my addEventListener work?

    jkintner

      This doesn't give me any compiler errors, but it doesn't work.  the function dimBall never gets called.   Can anyone help?

       

       

      <?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"
                     creationComplete="init()" >
          <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
          </fx:Declarations>
         
          <fx:Script>
              <![CDATA[
                  public function init():void{
                      circleOne.addEventListener(MouseEvent.MOUSE_OVER, dimBall);
                  }
                  public function dimBall(e:MouseEvent):void{
                      trace("in dimBall");
                      circleOne.alpha = .5;
                  }
              ]]>
          </fx:Script>
         
          <s:Ellipse id="circleOne" width="25" height="25" x="25" y="25" >
              <s:fill>
                  <s:SolidColor color="0xff0000" />
              </s:fill>
          </s:Ellipse>
         
      </s:Application>