flash and javascript interaction

Click on the select box on the left - the Flash map is updated. Click on the Flash map on the right - the select box is updated. (Unless you have an older version of Netscape or are using IE on a Mac)
Flash is not installed on your system - I'm afraid there's nothing to see here.

how this works (in two impenetrable paragraphs)

There are two methods of communication at work here. In the first method, the Flash movie sends a message to the browser using the FSCommand function in Flash. When the user clicks on a region on the map, Flash sends a message to a JavaScript function that either selects or deselects the appropriate value in the select box.

When the user clicks on a value in the select box, the second method of communication comes into play. When the status of the select box is changed, a JavaScript function loops through each item of the select box. For each item it sets a variable in the Flash movie corresponding to the status of that item - selected or unselected. Once this is done, the JavaScript function sets another variable as a signal for the Flash movie to call a function which sets the colours for each region according to the state of the variables.

<<back to tech index