Using Google maps in flash without flex

July 19th, 2008 · 12 Comments

I was excited at first when I heard the news that google had released an googlemaps api for flash/flex, but found out it was a little misleading since the flash sdk is only supported through flex. Problem for me is,  all of my projects as purely flash based without the need of the flex framework.

After and hour or so of searching, I finally found a version through the “google maps api for flash” google groups at http://groups.google.com/group/google-maps-api-for-flash/files (grab the latest file, at the moment its 1.5) that can be used in the flash development environment.

Before it can be used, you need to copy it to the “Adobe Flash CS3 - en - Configuration - Components” directory under the flash cs3 folder on your hard drive.

To use it, open the components panel in flash and drag the googlemaps component to the library and not the stage. From there, just import the classes and methods you need as outlined in the google maps  documentation. http://code.google.com/apis/maps/documentation/flash/reference.html

Also remember in order to get it working, you need to Sign up for a Google Maps API Key and replace the apiKey variable in the example below.

Google maps example in flash - Here’s a very simple example of how to embed googlemaps using the method above.

Tags:

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • Furl
  • Technorati

12 responses so far ↓

  • 1 astrid // Jul 20, 2008 at 8:10 pm

    Is it possible to use your example with Flash 8, too?

  • 2 ideaography Agi // Jul 21, 2008 at 12:16 am

    unfortunately no, as the googlemaps api is in Actionscript 3

  • 3 ideaography Agi // Jul 21, 2008 at 12:47 am

    I know this is in german, but it has some nice as3 examples for googlemaps:

    http://www.video-flash.de/index/tutorial-einfuhrung-in-google-maps-for-flashflex/

  • 4 tron // Jul 24, 2008 at 12:59 pm

    Having trouble installing into CS3 component directory on a mac. File types don’t seem to match the other types in there.

    on a mac the directory path seems to be Adobe Flash CS# > Configuration > Components.

    The download has 3 files; an xml file, a .png graphic and a library.swf. The other components in the component folder appear to have .swc files. Dropping the .swc downloaded from the google maps api webpage into the components folder doesn’t seem to have any effect either after restarting flash.

  • 5 ideaography Agi // Jul 25, 2008 at 12:31 am

    Dont unzip the map_flash_1_5.swc. If unzip it, then u will get the 3 files you were talking about.

    Instead, just place it in the components folder and add it into the library when you want to use it.

  • 6 ideaography Agi // Jul 25, 2008 at 12:32 am

    Here’s the discussion thread if you want more details:

    http://groups.google.com/group/google-maps-api-for-flash/browse_thread/thread/e5f22256a61a9f05/4ab77b7b3279b93a#4ab77b7b3279b93a

  • 7 Flash Framer // Aug 5, 2008 at 2:39 am

    I’ve been looking for this. Thanks for the info.

  • 8 Giles // Aug 5, 2008 at 3:45 pm

    many thanks for hunting for and finding this swc - a great help. rather typical of the adobe ‘help’ team not to mention this in the official documentaion and hide it away down some rabbit hole

  • 9 flash user // Aug 11, 2008 at 4:49 pm

    The geocode functionality is not working for me when I use it in conjunction with the flash application. Is this common?

  • 10 ideaography Agi // Aug 12, 2008 at 11:23 am

    geocode doesnt work locally, only when uploaded.

    I have it working on a server at work. Ill upload the demo later when i get a chance…

  • 11 tman // Aug 16, 2008 at 5:13 pm

    thanks a lot - that was a big help.

  • 12 Google Maps driving me Insane! - MacTalk Forums // Aug 24, 2008 at 11:27 pm

    […] the issue, see here… Home - AUG Vic - Adobe User Group Victoria In particular try these… `Using Google maps in flash without flex ideaography` http://www.muvclub.asn.au/mapdemo/ch…glemapTest.swf gMapComponent mymapdemo_v01 mymapdemo_v03 […]

Leave a Comment

To prove you're a person (not a spam script), type the security word shown in the picture.

Anti-Spam Image