2 Replies Latest reply on Dec 26, 2006 9:48 AM by James Newton, ACP

    Hide cursor?

    Level 7
      Hi

      I use command sprite(me.spriteNum).cursor={cursorNumber} to define spesific
      cursors for some sprites (for Buttons, etc)

      But I have a problem to hide the cursor at some moment

      When I use

      cursor 200

      I still can see the cursor over sprites, where cursor was defined with
      sprite(me.spriteNum).cursor={cursorNumber}
      How can I hide cursor over all sprites, even if they had their own cursor
      defined?

      Thanx in advance for any help


        • 1. Re: Hide cursor?
          James Newton, ACP Level 3
          sprite(x).cursor = y or "the cursor of sprite x = y" has priority over "cursor z". If you want to set specific cursors for specific sprites, and then be able to override these sprite cursors, you should use a cursor manager script (see attached code below). To test the script, try the following:

          1. Create a new movie
          2. Add a sprite with the following behavior:

          global goCursorManager
          property spriteNum


          on beginSprite(me)
          goCursorManager.SetSpriteCursor(spriteNum, 280)
          end beginSprite


          on endSprite(me)
          goCursorManager.SetSpriteCursor(spriteNum, 0)
          end endSprite

          3. Create a Movie Script with the following scriptText:

          global goCursorManager

          on prepareMovie()
          goCursorManager = script("Cursor Manager").new()
          end prepareMovie


          4. Run the movie. When you move the cursor over your sprite, you should see the finger cursor.
          5. In the Message window, type:

          goCursorManager.setGlobalCursor(4)

          6. You should now see the watch/hourglass cursor, even when you are over the sprite.
          7. In the Message window, type:

          goCursorManager.setGlobalCursor()

          The busy cursor should disappear, and the finger cursor should appear when the mouse is over the sprite.

          Is this enough information for you to be able to successfully hide the cursor in your own application?
          • 2. Re: Hide cursor?
            James Newton, ACP Level 3
            I have posted a demonstration of the Cursor Manager script at http://nonlinear.openspark.com/tips/sprites/cursor/. The source movie is available as a download.