1 Reply Latest reply on Jan 25, 2009 8:12 PM by Newsgroup_User

    Dynamic Cursor Using a Sprite?

    unc-astro
      I guess the first question I should ask is:
      Do cursor assets have to be embedded at compile time?

      If not, I am trying to make a cursor that is two circles of different diameters. Their diameters are to be chosen by the user. Once the user chooses the two diameters, I am creating a Sprite object and drawing the circles with graphics.drawCircle(). Now that I have this sprite object, how can I set it to be the cursor? CursorManager.SetCursor() takes a class? I know that I could hack CursorManager source code like is done here and use a Flash movie. But I am having a hard time believing that hacking CursorManager is the only way to make a simple dynamic cursor consisting of two circles. There has to be an easy way? right?

      Thanks!

      Josh
        • 1. Re: Dynamic Cursor Using a Sprite?
          Level 7

          "unc-astro" <webforumsuser@macromedia.com> wrote in message
          news:glj1hs$8td$1@forums.macromedia.com...
          >I guess the first question I should ask is:
          > Do cursor assets have to be embedded at compile time?
          >
          > If not, I am trying to make a cursor that is two circles of different
          > diameters. Their diameters are to be chosen by the user. Once the user
          > chooses the two diameters, I am creating a Sprite object and drawing the
          > circles with graphics.drawCircle(). Now that I have this sprite object,
          > how
          > can I set it to be the cursor? CursorManager.SetCursor() takes a class?
          > I
          > know that I could hack CursorManager source code like is done
          > http://jessewarden.com/2009/01/making-a-cooler-cursor-in-flex.html and use
          > a
          > Flash movie. But I am having a hard time believing that hacking
          > CursorManager
          > is the only way to make a simple dynamic cursor consisting of two circles.
          > There has to be an easy way? right?

          Just write your class and set a variable to it like this:

          private var customCursor:Class=com.yourCompany.CustomCursor;

          I think you're still going to have to hack the CursorManager in a way that's
          similar to what's described in order to set a variable on the instance of
          the class so that you can specify the diameter. You could also choose to
          try to hack it so that you use a ClassFactory instead of a Class, which
          would allow you to set properties on the instance before it is created.

          HTH;

          Amy