map of Wales using Flash Remoting and PHP
| Query |
|
|---|---|
| Anglesey | 10 |
| Blaenau Gwent | 60 |
| Bridgend | 80 |
| Caerphilly | 40 |
| Cardiff | 40 |
| Carmarthenshire | 100 |
| Ceredigion | 45 |
| Conwy | 75 |
| Denbighshire | 20 |
| Flintshire | 100 |
| Gwynedd | 50 |
| Merthyr Tydfil | 100 |
| Monmouthshire | 0 |
| Neath Port Talbot | 25 |
| Newport | 20 |
| Pembrokeshire | 22 |
| Powys | 20 |
| Rhondda Cynon Taf | 50 |
| Swansea | 0 |
| Torfaen | 50 |
| Vale of Glamorgan | 90 |
| Wrexham | 65 |
how this works
PHP
A PHP class resides in this directory. It contains a function which returns a query recordset (see data above right).
Flash
The map of Wales is a movie clip called "walesmap". It contains 22 further movie clips corresponding to each local authority region, as well as a movie clip called "border" which can be made visible or invisible.
When the flash movie is loaded, a connection is made to the Flash Remoting gateway. In PHP the gateway is an open source application called AMFPHP which resides on the server.
The function within the component is called and the recordset is returned. In the movie an ActionScript "colourMap" function then works through the recordset. For each local authority it finds the relevant movie clip and sets the color according to the gradient selected in the dropdown box. 100 is fully shaded, 0 is white.
<<back to tech index