2 Replies Latest reply on Mar 27, 2007 3:50 PM by lli123

    How to change a mouse iamge

      From the current MouseEvent, I cannot find any property can be used to set a icon or a image to the mouse. Anybody can give me a idea?

        • 1. Re: How to change a mouse iamge
          EliteScientist Level 1
          look at the CursorManager class
          • 2. Re: How to change a mouse iamge
            lli123 Level 1
            Now my problem is, athought the new mouse image for Cursor is show up,but the original mouse Cursor image still show up. So there are two images are displayed the same time. Here is I copy the code fromthe Flex document, and samething by run this code.

            <?xml version="1.0" encoding="utf-8"?>
            xmlns:mx=" http://www.adobe.com/2006/mxml"

            width="400" height="160"

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

            // Embed the SWF that will be used as
            // the custom cursor.

            public var HourGlassAnimation:Class;

            private const ON_MESSAGE:String = "Custom Cursor ON";
            private const OFF_MESSAGE:String = "Custom Cursor OFF";

            private function busyCursorButtonHandler(event:MouseEvent):void

            var toggleButton:Button = event.target as Button;
            if (toggleButton.selected)

            // The setCursor() method returns a numeric ID for
            // the cursor being set. You can store and use this
            // ID later in a removeCursor() call, or, you can
            // use the static currentCursorID property of the
            // CursorManager class to achieve the same result.

            toggleButton.label = ON_MESSAGE;

            toggleButton.label = OFF_MESSAGE;


            paddingBottom="10" paddingTop="10" paddingLeft="10" paddingRight="10"
            horizontalAlign="center" verticalAlign="middle"

            title="Custom cursor"

            <!-- Toggle button turns the custom cursor on and off. -->
            label="{OFF_MESSAGE}" toggle="true"


            <mx:Text text="Click the button to display or hide the custom cursor."/>

            Anybody has a idea how to control only show one mouse image for the mouse cursor?