0 Replies Latest reply on Nov 9, 2007 6:44 AM by gh_sg

    error message: Call to a possibly undefined method

    gh_sg
      i was reading the book on Flex 2 published by Wrox.

      This is the code (chapter 7):

      quote:

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">

      <mx:Script>
      <![CDATA[

      import mx.managers.CursorManager;
      import flash.events.*;

      private var cursorID:Number = 0;

      [Embed(source="busy.jpg")]
      private var busyCursorSymbol:Class;

      private function initImage(event:MouseEvent):void
      {
      cursorID = CursorManager.setCursor(busyCursorSymbol);
      myImage.load("image.jpg");
      }

      private function loadComplete(event:Event):void
      {
      CursorManager.removeCursor(cursorID);
      }

      ]]>
      </mx:Script>

      <mx:Image id="myImage" complete="loadComplete(event)"/>
      <mx:Button id="myButton" label="Show" click="initImage(event)"/>

      </mx:Application>


      The problem is, whenever i run it, i will always get the compiler error message:
      1061: Call to a possibly undefined method removeCursor through a reference with static type Class.

      I couldn't figure out why this is the case - i mean i have already import the CursorManager class, so why am i getting this error message?