1. Flash with Drupal
DrupalCon 2009 – Washington DC
Travis Tidwell
travist@tmtdigital.com
TMT Digital
2. Agenda
• Why Flash and Drupal?
• How Flash and Drupal Communicate
• Web Services in Drupal
• Asynchronous Programming
• Building a real Flash application for Drupal
6. Why Flash with Drupal?
• Flash is like … my wife
– It’s pretty.
7. Why Flash with Drupal?
• Flash is like … my wife
– It’s pretty.
– What you see is what you get.
8. Why Flash with Drupal?
• Flash is like … my wife
– It’s pretty.
– What you see is what you get. (WYSIWYG)
9. Why Flash with Drupal?
• Flash is like … my wife
– It’s pretty.
– What you see is what you get. (WYSIWYG)
• Drupal is like …
10. Why Flash with Drupal?
• Flash is like … my wife
– It’s pretty.
– What you see is what you get. (WYSIWYG)
• Drupal is like … me!
11. Why Flash with Drupal?
• Flash is like … my wife
– It’s pretty.
– What you see is what you get. (WYSIWYG)
• Drupal is like … me!
– It’s nerdy.
12. Why Flash with Drupal?
• Flash is like … my wife
– It’s pretty.
– What you see is what you get. (WYSIWYG)
• Drupal is like … me!
– It’s nerdy.
– Complicated
13. Why Flash with Drupal?
• Flash is like … my wife
– It’s pretty.
– What you see is what you get. (WYSIWYG)
• Drupal is like … me!
– It’s nerdy.
– Complicated
– but totally awesome!
18. How Flash and Drupal communicate
• Remote Function Calls (RPC)
– Uses XML to call a remote function
– AMF ( ActionScript Message Format )
19. How Flash and Drupal communicate
• Remote Function Calls (RPC)
– Uses XML to call a remote function
– AMF ( ActionScript Message Format )
20. How Flash and Drupal communicate
• Remote Function Calls (RPC)
– Uses XML to call a remote function
– AMF ( ActionScript Message Format )
<function>getHello</function>
21. How Flash and Drupal communicate
• Remote Function Calls (RPC)
– Uses XML to call a remote function
– AMF ( ActionScript Message Format )
<function>getHello</function>
“Hello World!”
27. How Drupal handles Flash RPC…
• Services module comes with “external” API’s
so that Flash can get Drupal data.
28. How Drupal handles Flash RPC…
• Services module comes with “external” API’s
so that Flash can get Drupal data.
– node.get
– node.save
– views.get
– etc…
29. Connecting to Drupal
• Flash must first establish a connection with
Drupal.
• Drupal manages the Flash connection using
Session ID’s
33. Session Handling
• Flash calls “system.connect”
• Drupal returns a valid Session ID to Flash
• Flash stores the session ID, then uses it for all
other calls to Drupal.
42. Asynchronous Programming
• Flash triggers actions based on events ( Event
Driven )
• Events move the system along
Register for event
43. Asynchronous Programming
• Flash triggers actions based on events ( Event
Driven )
• Events move the system along
Register for event
Make the call…
44. Asynchronous Programming
• Flash triggers actions based on events ( Event
Driven )
• Events move the system along
Register for event
Make the call…
Twiddle your thumbs…
45. Asynchronous Programming
• Flash triggers actions based on events ( Event
Driven )
• Events move the system along
Register for event
Make the call…
Twiddle your thumbs…
An event! Let’s
do something!
54. For more information…
• “Flash with Drupal” Book
– Author: Travis Tidwell (me)
– Packt Publishing
– Due July this year
• Topics covered
• Build a Flash recipe viewer
• Build a media player using Nodes and Views
• Build a Flash Five Star voter
• A bunch of other good stuff…