Druplash & Druplex
Building Content-Managed Flash/Flex Websites with Drupal
Who are we?
Brian McMurray
Adjunct Faculty, Bradley University Web and Interactive Developer, The Iona Group Drupal since ~2005
Steven Merrill
Faculty, Bradley University Webmaster, Slane College (at Bradley) Drupal since ~2006
cascadingStyle.net
What is Flash?
Flash is a file format (.swf), a browser plug-in for building multimedia animations and applications, and a vector-based tool which also supports integration of raster images, audio, video, embedded fonts. Flash is a layer- and timeline-based tool. Authors can produce animation by 'tweening' objects on the timeline, or programmatically using the ActionScript (AS) language. Many applications can produce Flash files. Adobe Flash is the main IDE, but Flex, Keynote and many others export to the .swf format.
Why Use Flash?
Designers love Flash. It allows for pixel-perfect design across all browsers. Authors can embed fonts. Flash is capable of embedding and streaming audio and video, as well as accepting live input of audio and video from a microphone or webcam. Flash is programmed in ActionScript. The current version, AS3, is based on ECMAScript 4. Adobe has open-sourced their AS3 runtime, code-named Tamarin. Mozilla will integrate it into future versions of Firefox.
http://www.adobe.com/aboutadobe/pressroom/pressreleases/200611/110706Mozilla.html
Who Can View Flash?
The player is ubiquitous. 99% of first-world Internet users have a browser with Flash Player 6, the first Flash Player to support the FLV video codec. Flash's single, pervasive codec laid the groundwork for YouTube. Flash Player 9, the latest version (required to use Flex and AS3) has 96.8% penetration in North America. Flash Player 9 Update 3 supports better hardware acceleration and HD H.264 video in any container file (mov, mp4, or 3gpp).
http://www.adobe.com/products/player_census/flashplayer/version_penetration.html
What is Flex?
Flex is an XML-based component framework that compiles down to Flash .swf files. Flex is to Flash as Rails is to Ruby. The term “Flex” encompasses Flex Framework, Flex Builder 3, and Flex Enterprise Services. It is a component library that allows greater (and faster) programmatic control of Flash. Flex is perhaps best described as a Rich Internet Application toolkit.
Aren’t They the Same Thing?
Flash (as an IDE) is far better for designers. The Flash authoring tool has sophisticated vector drawing and animation tools, layers and the timeline, the ability to embed fonts, and a decent ActionScript editor with a very nice language reference. Flex specializes in application-like functionality, and it has an Eclipse-based IDE. Eclipse is a far better code editor and has nice features like revision control integration. Flex has a visual view, but it is limited. Most large Flex projects are skinned with Flash.
But I Don’t Like Proprietary Solutions...
Flex is open source! (Mozilla Public License) The Flex Builder (the IDE) is still proprietary, but the Flex complier and SDK are open-source. So is AMF! Adobe is in the process of open-sourcing their Flex Data Services package, known as BlazeDS. BlazeDS makes it easy for Flex to communicate with databases. (Not that we care - we’ve got services.)
(but the Flash Player is still closed, you win there)
The Problems, historically:
Deep-Linking Browser History Bookmarking Search Engines Version Compatibility Disabled Users Mobile/Alternate Devices
The Solution: SWFObject
SWFObject ( http://blog.deconcept.com/swfobject/ ) Version Detection Standards Compliance EMBED tag, what? Alternate Content / Graceful Degradation
The Solution: SWFAddress
SWFAddress ( http://www.asual.com/swfaddress/ ) Browser History and Bookmarking SWFAddress.module ( http://drupal.org/project/swfaddress ) Allows spiders to crawl site, users with capable browsers are auto-redirected into Flash version, subject to restrictions: Specify URLs to be redirected into your Flash site Specify other criteria, like the minimum Flash version required to be redirected into your Flash experience site
How SWFAddress Works
SWFAddress is an MIT-licensed JavaScript library. It bridges ActionScript and JavaScript to allow for changes of URL and page title while navigating through a Flash site. It does this by using markers in the URL. When the SWFAddress library detects a change in the marker, it sends an event to the Flash file. Similarly, ActionScript can trigger a change of marker and hence URL and page title. The SWFAddress site has a good demo of how this works before we talk about applying this to Drupal.
http://www.asual.com/swfaddress/samples/seo/
SWFAddress & SWFObject
SWFAddress must be used with SWFObject, an MITlicensed JavaScript library that is used to place Flash files on web pages. SWFObject: Replaces an HTML element with a SWF based on the element’s ID, so you can present alternate (indexable) content underneath. Uses JavaScript and thus avoids the Eolas patent dispute’s “click to activate” hassle in IE/Win. Lets you avoid writing invalid