Accessibility
Charles Freedman

Charles Freedman

Yahoo! Maps

Table of Contents

Created:
22 May 2006
User Level:
Intermediate
Products:
Flash

Using the Yahoo! Maps Flash API

With the release of Yahoo! Maps beta, an ActionScript and Flex-based map application, Yahoo! also released the Maps beta API. This API is designed to give you the unique opportunity of integrating much of the enhanced functionality and precise map data into your own Macromedia Flash applications.

The Yahoo! Maps API is distributed as a Flash component, packaged to integrate easily into your own code. Because Yahoo! serves up the mapping data, there are no server requirements on your part other than snapping in the simple component. Once I walk you through the quick component installation (same as any MXP packaged V2 component), I'll review with you several copy-and-paste code examples. Within minutes, you'll be building a map-based application that allows your users to pan, zoom, and even search and display listings from the Yahoo! Local Search.

The best part is that, thanks to the inventory of simple API calls, adding each of these great features requires no more than a simple understanding of a few lines of code. The sky's the limit—and you have over a dozen zoom levels to explore it.

Requirements

In order to make the most of this article, you need the following software and files:

Macromedia Flash 8

Note: You can also use Macromedia Flash MX 2004.

You need an application ID to use the AS-Flash API (Yahoo! login required).

Notes about the sample code in this article:

  • Throughout this article, I will continue to mention the very comprehensive Reference Manual for the Yahoo! Maps Flash APIs. The Yahoo! Developer Network has put together a great launch pad to get you started with the Maps component.
  • The examples in the article are full copy-and-paste code excerpts. While I encourage you to add your own elements, I wanted to provide you with as much of a head start as possible.
  • To implement all the code examples, you can simply add them to the first frame of your FLA file. It is good practice to create separate layers for the component and the ActionScript.
  • If you are using an IDE such as Eclipse, PrimalScript, or SEPY, you can drop the code in your AS script or class files to work with your application.
  • Start each section with a new FLA file. This is how I wrote each example and it helps to have a clean slate to understand the unique functionality being presented.

About the author

Charles (Chuck) Freedman is a senior Flash developer for Yahoo! Maps, where he leads development for both the consumer and API versions of the Flex-based Maps application. With a Communications degree in Film and Television from Boston University, Chuck combines his education in multimedia with expertise in content management, server-side scripting, and database and interactive design. Recently he has produced some of the most highly visible dynamic Flash content, developing modules for the home pages of eBay, eBay China, and Fidelity. Visit his website at chuckstar.com. Born in Boston, Chuck relocated with his wife Jamie to sunny Santa Clara, Calif., to join Yahoo! in 2005. Still a season ticket holder, he is planning many trips back east to see his beloved Red Sox win another World Series.