# Presentation: 676269

## Pretty Isn’t Enough For a Long-Term Relationship

- By: Kelly Sponberg (kelly.sponberg@noaa.gov)

- Improving Your Content Through Database-Driven Flash Applications

## Required Software

- PHP (or other server side processing language)
- MySQL (or your favorite database)
- Macromedia Flash 5.0 +

## The Problem and Case Study

- The CIP produces a summary of reported disaster losses roughly twice a week.  Global in scope, the reports are text heavy.  We wanted something image based, which would help to attract users not familiar with the product.
- Additionally, the text version of our summary cannot provide an “at-a-glance” view of the report and/or impart regional and spatial relationships.

## Our First Thoughts

- Create a map.
- BUT....................
- A static map would burden the developer (namely us) too much with image creation and web management.
- Advanced GIS web applications/servers are expensive and are overkill for a product which only needs basic spatial references.

## The Reality of Maps on the Web

- Maps on the web are most often used for visual cues and NOT for the advanced layering and analysis associated with a GIS application.

## Using Flash

- 90%+ of web browsers in use are Flash enabled.
- While Flash 4.0 and earlier versions lacked a sophisticated scripting language, Actionscript in Flash 5.0+ is a powerful language integrated into a visual development environment, with significant database integration.
- Combined with a database, it is now easy to serve dynamically advanced and visually appealing presentations.

## Using Flash With Spatial “Accuracy”?

**Flash (.swf) Space**

- Y

- X

**(0,0)**

## Flash Structure:  The Stage, Actor, and Director

## Actors and Actions of Our Map

**Hold Data, ****Run Functions ****Based on Data**

**Run PHP to Get Data**

**Duplicate Self, ****Place Self Based Upon (X,Y), ****Morph to Reflect Proper Icon, Remember Catalog Number**

**Show Text Information****When Icon Clicked.  Use Icons Catalog Number.**

## Loading Data

**loadVariables ("flashmapselector.php?method=latest", _root.infomc2);**

**_root.infomc2**

**function ( )**

## Follow Basic PHP and MySQL To Process and Return Data

- //  if flashmapselector.php?method=latest , get the latest entry date.
- if ($method == "latest")
- {
- $sQuery = "SELECT DISTINCT date FROM impactupdate WHERE xpoint > 0 AND ypoint > 0 ORDER BY date DESC limit 1";
- $rResult = mysql_query($sQuery,$linkID);
- // make sure that we recieved some data from our query
- $num_of_rows = mysql_num_rows($rResult)
- or die ("topic1=Sorry, no information on your selection is available at this time");
- # use mysql_fetch_row to retrieve the results
- for ($count = 1; $row = mysql_fetch_row ($rResult); ++$count)
- { $num=$count;
- // print out the query, in this case, all the same dates that have xy values.
- $finalquery = "&count=$num_of_rows&date$num=$row[0]";
- echo "$finalquery";

## Online Example of Map

- Click to Open Site

## The Potential for More Advanced Flash Mapping?  Flash GIS?

** ****Raster Images, no problem**
** ****Vector Images, no problem**
** ****Layering, no problem**
** ****Analysis, uh.......sure**
**Simply need “Base” Information (Country Borders).  These can be imported as CAD.  The difficulty is determining a standardized data format which could be processed by any server side application.  **

## Flash and 508

** ****Flash Capacity for 508 vs Unique Purpose for Flash**** **
** ****http://www.macromedia.com/software/flash/productinfo/****tutorials/gettingstarted/**** **
**The amended Section 508 requires that: **
**"...electronic and information technology allows Federal employees with disabilities to have access to and use of information and data that is comparable to the access to and use of information and data by Federal employees who are not individuals with disabilities, unless an undue burden would be imposed on the agency." **

## Flash and 508

** ****Accessibility New to Flash MX – Not in v5.0 or less.**
** ****Only Movie Clips, Buttons, and Input/Dynamic Text Can Be Assigned Accessibility Descriptions – Therefore All Single Frame Graphics Should Be Made Into Movie Clips.**
** ****Dynamic Content Should Be Limited.**
** ****Of Course to Truly Test Your Flash Movie You Need An Appropriate Reader.**

## Slide 16

## Slide 17

## Additional Information

**Climate Information Project****http://www.cip.ogp.noaa.gov**** **
**Flash Tutorials****http://www.were-here.com, http://www.flashkit.com**** **
**PHP****http://www.php.net**