Transcript Title

Flash and ColdFusion
Using Multiple Front Ends with a
CF Backend.
Sandra Clark
Shayna Productions
[email protected]
www.shayna.com
The Challenge
• How to use the same ColdFusion pages to serve
multiple Front Ends (Flash, HTML) with no
changes.
• Why?
– Flash has 96% penetration rate.
• Same on all Browsers
– Multiple Front ends using the same back end
make it easier to port apps.
• Section 508, HTML, WAP, FLASH
The Problems
• How to get information into each front
end without changing backend
programming.
• Each front end has to be able to
handle the same type of data.
The Requirements
• Each front end must be responsible for retrieving
user input and processing it so that the ColdFusion
server can use it in the same way.
• Each front end must be responsible for retrieving
data and processing it for display.
• Back end must only be responsible for gathering
information, running business tier, talking to
database, and packaging up data for sending to
front end.
The Flow
FLASH
FRONT
END
HTML
FRONT
END
WAP
FRONT
END
Front End Package
process received data
and displays it.
Front end packages up data request and
sends it to CF Server for processing.
COLDFUSION
SERVER
Cold Fusion applies business rules,
packages up data
to be sent and sends to
Appropriate Front End.
CF Request information from
Database Server and packages up information
to return to Front End
DATABASE
SERVER
The Solution
• XML
– Standard way of sharing data
– Both CF and Flash can handle XML with
Parsers
• CF_XMLPARSER from CFDev.com
• Flash 5.0 has xml object built in
Can it Work?
ON TO THE CODE!
Gotchas
• Debugging is a pain (Flash)
– Could never get XML working in test mode,
• Had to publish it to get XML working.
– Flash kept caching the call to calc.cfm. Had to
add a random number to the URL to make it
work correctly.
– Make sure debugging is off in CF Template,
Flash cannot handle anything other than the
XML coming back.
• NO WHITE SPACE
Gotchas (2)
• Debugging is a Pain (CF)
–
–
–
–
–
–
Can’t see errors in a browser.
Use CFAdmin Application Log to find errors.
Use <CFFile> to write outputs to text file.
No White Space – Use CFSilent
Use ReReplace to get rid of extra white space.
Coming from HTML <CFHTTP>
• Get rid of “attribute = “ part before parsing XML
Links/References
• Books
–
–
–
–
–
Foundation Flash (Friends of Ed)
Foundation Actionscript (Friends of Ed)
Flash XML Studio (Friends of Ed)
Actionscript The Definitive Guide (O’Reilly)
Inside XML (New Riders)
• Lists
– CFTalk (House of Fusion – houseoffusion.com)
– Flash List (Figleaf - chattyfig.figleaf.com)
• Sites
– xml.org
– Flashcfm.com
– www.macromedia.com/software/coldfusion/resources/flash_coldfusion
Flash/Dynamic Sites
•
•
•
www.franklinplanner.com
www.ihotelier.com/onescreen/onescreen.cfm
CF_FlashBoard
– http://www.mallofcharleston.com/flash/cf_flashboard/purchase.cfm
•
•
www.smallblueprinter.com
www.egomedia.com