4 Replies Latest reply on Aug 12, 2006 10:03 PM by Matlus

    Image Maps?

    Matlus
      Is it possible to have the concept of image maps (like in html) in ActionScript? That is I have an image that may have many active "area" (determined by using coordinateslinke in html image maps) and depending on the active area cliked on or rolloed over, I'd like to do different things.

      Appreciate any help, documents. websites etc.

      Shiv.
        • 1. Re: Image Maps?
          peterent Level 2
          ActionScript and the Flash Player do not support image maps in the way HTML does. You can have an image and listen for click events. The MouseEvent dispatched contains the coordinates of the click. Use those to determine what you want to do.

          If you want to change the cursor over a hot area, watch the mouse's movements and switch the cursor when it enters a region.

          Alternately you can supply additional transparent images of irregular shape and listen for events on those. You could also look up the hitTest function and see if that would be useful.

          ActionScript provides any number of solutions to this problem. You may think that this is way harder than HTML. But consider that to give you that ease of use, the browser has to have a lot of code in it to do this very thing. Here, you can code it as effeciently as you like.
          • 2. Re: Image Maps?
            Matlus Level 1
            Peter,

            Once again, thank you for your reply.

            I like the transparent image option. I have the coordinates of the hot areas, and that will allow me to create these images on the fly and possibly, super impose these over the original. that way, the click event pertains to a specific (transparent) image and I can do what I need to from there.

            Where can I find more information/samples on this kind of thing?

            As a side note, I think ActionScript should have this kind of thing "out-of-the-box". Those who want more "efficiency" still have the option to "do-it-yourself". My 2 cents worth.

            Shiv.
            • 3. Re: Image Maps?
              peterent Level 2
              Check out the Bitmap classes. Perhaps you could come up with a handy component and publish or sell it. Flex does create opportunities, too.
              • 4. Re: Image Maps?
                Matlus Level 1
                > Flex does create opportunities, too

                :-) I'm sure it does. And I might just make such a component.

                Being totally brand new to ActionScript (of any version) I was asking before I assumed or expected, but I did hope :-).