4 Replies Latest reply on Dec 17, 2009 6:48 PM by kglad

    How to create a huge interactive map?

    peflorencio

      Hello everybody

       

      I've started learning Flash two weeks ago and I have the challenge of creating an interactive political map with about 4000 cities. Some cities will have more than 600 lines defining their limits which will make this project very demanding on processing.

       

      People will be able to zoom in/out, select cities and see information about them.

       

      As a starting point, I've begun working with 500 cities. I've imported a vectorial drawing of these cities and converted each one of them to symbols using flash javascript, resulting of course in 500 symbols. I don't know if it was a good way of starting this project but worked for me. Then my problems begun.

       

      First I tried to use the mouse roll over and roll out events to change the (fill) color of cities but the city limits (stroke) changed also.

      Second I want to add some properties to the cities such as city code, name, etc. but I wasn't able to do that using class inheritance. Would I have to create a different City class for every symbol I would like to extend? This approach looks like a lot of headache and redundant work.

       

      Finally my question is should I start all over again and change my approach? If yes, how? If no, how can I solve those two problems?

       

      Thanks

        • 1. Re: How to create a huge interactive map?
          kglad Adobe Community Professional & MVP

          zooming is going to be a problem with that many objects in the displaylist.  you should consider doing that without using a zoom.

          • 2. Re: How to create a huge interactive map?
            carl schooff Level 3

            can't answer everything but I find this project very ambitious for someone with 2 weeks experience. I give you credit for trying.

             

            as for the color changes, in each city symbol you need to have a separate "fill" symbol so that you can change the color of the fill and not the stroke.

             

            also this link will help you understand the concept and confusion of target, currentTarget, mouse_over vs roll_over:

            http://www.wastedpotential.com/?p=10

             

             

            if each of your mc's is using a City.as class, that should work fine for giving each city the same properties. No need to create 500 different classes. I'm not an OOP expert but I know what you are trying is very possible and should be straight-forward.

             

            Get Colin Moock's Essential ActionScript 3.0 and Shrupe's Learning ActionScript 3.0 for a crash course on implementing something like this.

            1 person found this helpful
            • 3. Re: How to create a huge interactive map?
              peflorencio Level 1

              Thanks for your answer meqlomor

               

              I tried to link my movieclips to a single class but I think Flash asked for distinct classes to each one of them. I'll give another shot tomorrow.

               

              Regarding the fill color issue, creating a separate "fill" symbol for each city would double the number of symbols. I am now considering to remove the outline of the symbols and make the gap between them longer. This way the gap will act as an outline. And maybe create a single symbol to serve as background for the map, filling the gaps with some other color.

               

              I'll keep reporting my progress

               

              Thx again

              • 4. Re: How to create a huge interactive map?
                kglad Adobe Community Professional & MVP

                (you're making a mistake to ignore my message.)