Cuyamaca Collegeskip to content
Apply & Enroll
Departments
Help for Students
Find People
Online Services
Campus Information
Student Activities
Graphic Design: 

 
Flash Distraction
of the Week

About Cartoon Smart

GCCCD Blackboard

GD 222
Home
Syllabus
Schedule
News
Labs
Videos
Flash Resources
Web Dev Resources

 

GD 222 Flash Web Animation - Spring, 2008
Online Course
http://www.cuyamaca.edu/jeff.sale/gd222/

Lab 9:
Maps with Flash and Yahoo Maps API
Baro

(This lab is due Tuesday, May 13, 2008)

Below is a simple example of some of the things you can do with Flash Maps using the Yahoo Maps API. For this lab, we will be doing the following:

  • Adding a script to one of the buttons, the 'Hide Marker' button,
  • Changing the address of a marker
  • Changing the starting location of the map
  • Adding a second marker close to the first

To begin, explore the sample map below and download the file for this animation by right-clicking this link and selecting "Save Target As...".

Add a script to the 'Hide Markers' button

To add an ActionScript script to the 'Hide Marker' button, select the button with the ActionScript panel open. In the ActionScript panel, type the following text:

on (release) {
  myMap.removeAllMarkers();
}

Save your file and test it by clicking the 'Show Marker' button and then the 'Hide Marker' button.

 

Change the address of a marker

Next, you will change the address of the marker to be your own address. Select the 'Show Markers' button and in the ActionScript panel locate the following line in the script:

var address = "9500 Gilman Drive, La Jolla , CA";

Change this address to your own address. Change any of the other text in the script where the gMyMarker variable is defined.

 

Change the starting location of the map

Next, click the region on the Stage where the map is located (even though you can't see the map, it's there and you can click it). Select the Parameters panel at the bottom next to the Properties panel. Locate the Address parameter and enter your address in place of the existing UCSD address. By changing this address, the map should open with its center located on your house. Save and test your file.

 

The Final Challenge: Add a Second Marker

Finally, add a second marker close to the first marker so that they both appear when the "Show Markers" button is clicked.

 

For Future Exploration

Visit the following sites for more examples and reference material:

Yahoo Flash Maps API Reference Manual

Yahoo Flash Maps API Getting Started Guide

That's it for Lab 9. Locate Lab 9 on the Assignments page of the Blackboard course web site and follow instructions to turn in your .fla file.

Good luck with your own Flash mapping adventures!!

 

Jeff Sale

E-mail: jeff.sale (at) gcccd.edu
Phone: 619-660-4000
Fax: 619-660-4399
Graphic Design, Cuyamaca College
You may also reach me at jsale37 (at) gmail.com

 

 

Page footer information