flash and javascript interaction
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