6 Replies Latest reply on Jul 12, 2010 2:51 AM by Kwangle

    Irregular movieclip shapes

    TomazDrnovsek

      Hi!

       

      I have a coutry map and every state is clickable movieclip. But the states are not rectangular shaped, they are irregular shaped. How can I define hit area for those movieclips (they overlap in some areas and that's the problem)? Is it possible?

        • 1. Re: Irregular movieclip shapes
          Ned Murphy Adobe Community Professional & MVP

          I don't understand how states can overlap--what do you mean, and how do rectangular shapes fit into this situation?.  If you have the irregular shape of the movieclip as a graphic, then use it to define the hit area (though I am not sure what you intend when you say "hit area").

          • 2. Re: Irregular movieclip shapes
            TomazDrnovsek Level 1

            Ok, my English is obviously not that good.

             

            Here is the picture of my problem (just an example, I have 200 of those). There are 5 movieclips, on mouseover the hover caption appears (with the name of the area) and the color changes.. but as you can see they overlap - one is completely overlaped. Is there any way to define "Hit" state as you can with buttons (Up, Over, down, Hit)? Or maybe any other solution? I'm not an AS expert, obviously

            • 3. Re: Irregular movieclip shapes
              Kwangle

              just add an invisible button to each state that is the same shape and size as the state

              itself with code attached that does what you want when it is clicked.

              • 4. Re: Irregular movieclip shapes
                TomazDrnovsek Level 1

                I don't know if this would work if I already have a lot of code (which I just begin to understand) for mouseover animation, color change, hover caption,.. here you can see the effect (it's all AS2). Can I put this invisible button under the movieclip? Any help would be more than welcome

                • 5. Re: Irregular movieclip shapes
                  TomazDrnovsek Level 1

                  Can I use the invisible button technique and still achieve this effect/functionality ?

                  • 6. Re: Irregular movieclip shapes
                    Kwangle Level 1

                    Yes its very easy and you do not need any code as it is all handled bt the button. Buttons have four states, each of which is a frame inside the button movie clip:

                     

                    Up: the normal appearance of the button when the mouse pointer isn't near it. This can be invisible (a blank frame) or be any graphics

                    Over: the appearance of the button when a mouse pointer is over its hit area. This can be invisible (a blank frame) or be any graphics

                    Down: The appearanc eof the button when a mouse pointer is over its hit area and the mouse button is pressed. This can be invisible (a blank frame) or be any graphics

                    Hit: The area of the button that responds to the mouse pointer being over it. This is not visible on screen at any time but must always be defined for the button to work. When the mouse pointer enters this area the button can be pressed and also jumps to its over or Down states.

                     


                    For visible buttons the button is usually a well-defined area which changes size and colour when a mouse pointer rolls over it (so the user knows it is a button). Buttons oftern get bigger and change to a brighter colour when a mouse pointer rolls over them (like thye are popping out of the screen) and get smaller and darker when they are pressed (which looks like the button is sinking into the screen when it is pressed). The hit state is usually the same size as the up state or bigger to make clicking on it easier. If the up state is text a block that totally covers the area of the up state is best.

                     

                    Invisible button often have blank Up, Over and Down states and a Hit state as a simple block or other shape - they show up on screen as trnasparent blue so you can see them while you are working, but are not visible when the movie plays.

                     

                    In your case your button could be:

                    Up: the shape of your country in its normal colour.

                    Over: the shape of your country in a selected colour (if you want)  and the grey box

                    Down: Same as Over but with the country in another color (if you want)

                    Hit: The shape of the country - colour doesn't matter as this state is never visible