Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg ([email protected])...

18
Pretty Isn’t Enough For a Long- Term Relationship By: Kelly Sponberg ([email protected]) Improving Your Content Through Database-Driven Flash Applications

Transcript of Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg ([email protected])...

Page 1: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

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

By: Kelly Sponberg ([email protected])

Improving Your Content Through Database-Driven Flash ApplicationsImproving Your Content Through

Database-Driven Flash Applications

Page 2: 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 SoftwareRequired Software

PHP PHP (or other server side processing language)(or other server side processing language)

MySQL MySQL (or your favorite database)(or your favorite database)

Macromedia Flash 5.0 +Macromedia Flash 5.0 +

Page 3: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

The Problem and Case The Problem and Case StudyStudy

The CIP produces a summary of reported The CIP produces a summary of reported disaster losses roughly twice a week. disaster losses roughly twice a week. Global in scope, the reports are text heavy. Global in scope, the reports are text heavy. We wanted something image based, which We wanted something image based, which would help to attract users not familiar with would help to attract users not familiar with the product.the product.

Additionally, the text version of our summary Additionally, the text version of our summary cannot provide an “at-a-glance” view of the cannot provide an “at-a-glance” view of the report and/or impart regional and spatial report and/or impart regional and spatial relationships.relationships.

Page 4: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

Our First ThoughtsOur First Thoughts

Create a map.Create a map.

BUT………………..BUT………………..

A static map would burden the developer A static map would burden the developer (namely us) too much with image creation and (namely us) too much with image creation and web management.web management.

Advanced GIS web applications/servers are Advanced GIS web applications/servers are expensive and are overkill for a product which expensive and are overkill for a product which only needs basic spatial references.only needs basic spatial references.

Page 5: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

The Reality of Maps on the The Reality of Maps on the WebWeb

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

Page 6: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

Using FlashUsing Flash 90%+ of web browsers in use are Flash enabled.90%+ of web browsers in use are Flash enabled.

While Flash 4.0 and earlier versions lacked a While Flash 4.0 and earlier versions lacked a sophisticated scripting language, Actionscript in sophisticated scripting language, Actionscript in Flash 5.0+ is a powerful language integrated into a Flash 5.0+ is a powerful language integrated into a visual development environment, with significant visual development environment, with significant database integration.database integration.

Combined with a database, it is now easy to serve Combined with a database, it is now easy to serve dynamically advanced and visually appealing dynamically advanced and visually appealing presentations.presentations.

Page 7: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

Using Flash With Spatial Using Flash With Spatial “Accuracy”?“Accuracy”?

Flash (.swf) SpaceFlash (.swf) SpaceFlash (.swf) SpaceFlash (.swf) SpaceY

X

(0,0)

Page 8: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

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

Page 9: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

Actors and Actions of Our MapActors and Actions of Our Map

Hold Data, Hold Data, Run Functions Run Functions Based on DataBased on Data

Run PHP to Get DataRun PHP to Get Data

Duplicate Self, Duplicate Self,

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

Show Text Show Text InformationInformationWhen Icon When Icon Clicked. Use Clicked. Use Icons Catalog Icons Catalog Number.Number.

Page 10: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

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

_root.infomc2_root.infomc2

function ( )function ( )

Loading DataLoading Data

Page 11: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

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

// if flashmapselector.php?method=latest , get the latest entry date.// if flashmapselector.php?method=latest , get the latest entry date.if ($method == "latest")if ($method == "latest"){{$sQuery = "SELECT DISTINCT date FROM impactupdate WHERE xpoint > 0 AND ypoint > 0 ORDER BY $sQuery = "SELECT DISTINCT date FROM impactupdate WHERE xpoint > 0 AND ypoint > 0 ORDER BY

date DESC limit 1";date DESC limit 1";$rResult = mysql_query($sQuery,$linkID);$rResult = mysql_query($sQuery,$linkID);

// make sure that we recieved some data from our query// make sure that we recieved some data from our query

$num_of_rows = mysql_num_rows($rResult)$num_of_rows = mysql_num_rows($rResult)

or die ("topic1=Sorry, no information on your selection is available at this time");or die ("topic1=Sorry, no information on your selection is available at this time");

# use mysql_fetch_row to retrieve the results# use mysql_fetch_row to retrieve the results

for ($count = 1; $row = mysql_fetch_row ($rResult); ++$count)for ($count = 1; $row = mysql_fetch_row ($rResult); ++$count)

{ $num=$count;{ $num=$count;

// print out the query, in this case, all the same dates that have xy values.// print out the query, in this case, all the same dates that have xy values.$finalquery = "&count=$num_of_rows&date$num=$row[0]";$finalquery = "&count=$num_of_rows&date$num=$row[0]";echo "$finalquery";echo "$finalquery";

Page 12: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

Online Example of MapOnline Example of Map

Click to Open Site

Page 13: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

The Potential for More Advanced The Potential for More Advanced Flash Mapping? Flash GIS?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.

Page 14: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

Flash and 508Flash 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."

Page 15: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

Flash and 508Flash 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.

Page 16: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.
Page 17: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.
Page 18: Pretty Isn’t Enough For a Long-Term Relationship By: Kelly Sponberg (kelly.sponberg@noaa.gov) Improving Your Content Through Database-Driven Flash Applications.

Additional InformationAdditional Information

Climate Information Projecthttp://www.cip.ogp.noaa.gov

Flash Tutorialshttp://www.were-here.com, http://www.flashkit.com

PHPhttp://www.php.net