2 Replies Latest reply on Mar 28, 2008 6:36 AM by PLauchman

    FLASH Symbol's Bounding Irregular Polygons

    PLauchman
      I'm working on a Flash CS3 map containing a lot of irregular polygons. Each polygon is a "button."

      The original graphics were imported from Photoshop. Each layer contained a polygon defining a country. Each polygon was saved as graphic symbol, the graphic symbol was included in a movie clip. Each country in an individual MC. The over and out state is defined in a simple function in the main stage actions. That all works just fine.

      I believe I'm hitting a wall though where the bounding rectangle defining each symbol overlaps. Depending on the layer order in the original SWF, sometimes hovering over one polygon selects another.

      I can solve some of the issues by re-ordering the layers, but this won't fix all of them by any means, and this is just a band-aid anyway. I need a more robust solution.

      Is there a setting in Flash CS that specifies Flash is to use the actual shape of a polygon rather than a least-fit rectangle? I understand that I could use Flash Buttons and manually draw a hit area for each country, but this will be a long, error-prone process. It too will yield results that are only "close."

      Flash has the polygon -- can't the edges of that polygon be used as a hit area?

      If it's not obvious, I'm new to CS. One of my difficulties is determining what Flash calls this least-fit bounding rectangle -- important to have a proper keyword for any search engine.

      Any advice would be appreciated!

      TIA --
        • 1. Re: FLASH Symbol's Bounding Irregular Polygons
          RossRitchey Level 4
          When you say "imported from Photoshop" do you mean you saved them out as images and then imported them? Or did you import a .psd directly into Flash?

          It sounds like you are using images, in which case Flash recognizes the rectangle bounding box as the entire hit area (because images can only be rectangular). Transparent PNG's shouldn't have this problem in Flash, but it might be a bug. Regardless, if you import a layered PSD directly into Flash, you can tell it to import shape layers in the psd as editable paths.

          Another solution is to try to create the hit areas in Flash with what you currently have, and use the Modify/Bitmap/Trace Bitmap command. Set the Color threshold and Minimum area both to "1" Set the Curve fit to "Pixels" and the Corner threshold to "Many corners" This will reproduce your image in vectors extremely accurately. If you are using singly colored polygons, then this should not be a problem at all. Once you have the essential polygonal shape as a vector, you can make it all 1 color, and then make it an invisible hit area.
          • 2. FLASH Symbol's Bounding Irregular Polygons
            PLauchman Level 1
            A thousand thanks, RRitchey. The Modify > Bitmap > Trace Bitmap trick worked beautifully.

            I sincerely appreciate you taking the time to respond.

            Best,
            Paul