INFO 424 SCHEDULE

Flash Quiz #2 Add an info box to the choropleth map

Download this copy of the choropleth map file. You will be modifying this file. If you look in the library, you'll see that I've added an information box symbol called "popUp_mc".

Much of the code you'll write for this exam can be modeled on the code you wrote in the Olympic Medals application. Here is a copy from Medals, Phase 9 for reference.

Instructions:

Write comments in your code explaining what you're doing. You can also explain any problems you're having. This will enable me to give you some credit even if you run into a snag and can't make something work or run out of time. Reminder: preceed single-line comments with '//' and enclose multiple-line comments between '/*' and '*/'

Task 1: Make the information box invisible when you run the movie.

Task 2: Add event listeners and corresponding functions to each US state to make the information box appear when you hover over that state, and disappear when you move the cursor away. (You don't need to be elegant - it's fine to make these all separate functions rather than trying to figure out how to combine them into one).

Task 3: Make the information box follow the cursor (here's the code module which shows how to do that).

Task 4: Import this XML file. Here is the code module to remind yourself how to do this.

Task 5: Write a trace statement that will write out the name of the button when you move the mouse over a it (i.e. just before you make the info Box visible). Then refine that trace statement to pull out just the name of the state by following this model:

myString.substr(0,(myString.length-10));

// the 'substr' function gets a portion of a string.

//It takes 2 parameters - the first is the character to start at, the second is the number of characters to include

Task 6: Add the name of the state to the info box (you'll need to figure out the name of the text field in popUp_mc to do this).

Task 7: Figure out how to get the data value from the "informationJob" element of the XML file (you can look at Medals_9_XML.fla for a model of an XML reference), and if you're having trouble, use the strategy of writing a series of trace statements starting with one that shows the whole XML object, then narrowing down to the single value you want to retrieve.

Task 8: Add this data value to the info box.

Task 9: Test to see if the utilities button has been checked. If it has, display the utilities data instead of the information data.

Be sure you've added comments to your code, then...

Upload the .fla file to Canvas