Top Banner
Flash with Drupal Travis Tidwell [email protected] TMT Digital DrupalCon 2009 – Washington DC
55

Drupalcon 2009 Flash and Drupal

May 19, 2015

Download

Design

gdoteof

Travis Tidwell presents at DrupalconDC 2009
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Drupalcon 2009 Flash and Drupal

Flash with Drupal

Travis [email protected]

TMT Digital

DrupalCon 2009 – Washington DC

Page 2: Drupalcon 2009 Flash and Drupal

Agenda

• Why Flash and Drupal?• How Flash and Drupal Communicate• Web Services in Drupal• Asynchronous Programming• Building a real Flash application for Drupal

Page 3: Drupalcon 2009 Flash and Drupal

Why Flash with Drupal?

Page 4: Drupalcon 2009 Flash and Drupal

Why Flash with Drupal?

• Flash is like …

Page 5: Drupalcon 2009 Flash and Drupal

Why Flash with Drupal?

• Flash is like … my wife

Page 6: Drupalcon 2009 Flash and Drupal

Why Flash with Drupal?

• Flash is like … my wife– It’s pretty.

Page 7: Drupalcon 2009 Flash and Drupal

Why Flash with Drupal?

• Flash is like … my wife– It’s pretty.– What you see is what you get.

Page 8: Drupalcon 2009 Flash and Drupal

Why Flash with Drupal?

• Flash is like … my wife– It’s pretty.– What you see is what you get. (WYSIWYG)

Page 9: Drupalcon 2009 Flash and Drupal

Why Flash with Drupal?

• Flash is like … my wife– It’s pretty.– What you see is what you get. (WYSIWYG)

• Drupal is like …

Page 10: Drupalcon 2009 Flash and Drupal

Why Flash with Drupal?

• Flash is like … my wife– It’s pretty.– What you see is what you get. (WYSIWYG)

• Drupal is like … me!

Page 11: Drupalcon 2009 Flash and Drupal

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.

Page 12: Drupalcon 2009 Flash and Drupal

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

Page 13: Drupalcon 2009 Flash and Drupal

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!

Page 14: Drupalcon 2009 Flash and Drupal

Combine Beauty with Power and you get…

Page 15: Drupalcon 2009 Flash and Drupal

Combine Beauty with Power and you get…

Page 16: Drupalcon 2009 Flash and Drupal

Combine Beauty with Power and you get…

Page 17: Drupalcon 2009 Flash and Drupal

How Flash and Drupal communicate

Page 18: Drupalcon 2009 Flash and Drupal

How Flash and Drupal communicate

• Remote Function Calls (RPC)– Uses XML to call a remote function– AMF ( ActionScript Message Format )

Page 19: Drupalcon 2009 Flash and Drupal

How Flash and Drupal communicate

• Remote Function Calls (RPC)– Uses XML to call a remote function– AMF ( ActionScript Message Format )

Page 20: Drupalcon 2009 Flash and Drupal

How Flash and Drupal communicate

• Remote Function Calls (RPC)– Uses XML to call a remote function– AMF ( ActionScript Message Format )

<function>getHello</function>

Page 21: Drupalcon 2009 Flash and Drupal

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!”

Page 22: Drupalcon 2009 Flash and Drupal

How Drupal handles Flash RPC…

Page 23: Drupalcon 2009 Flash and Drupal

How Drupal handles Flash RPC…

• Services Module

Page 24: Drupalcon 2009 Flash and Drupal

How Drupal handles Flash RPC…

• Services Module• AMFPHP Module

Page 25: Drupalcon 2009 Flash and Drupal

How Drupal handles Flash RPC…

• Services Module• AMFPHP Module• AMFPHP ( http://www.amfphp.org )

Page 26: Drupalcon 2009 Flash and Drupal

How Drupal handles Flash RPC…

Page 27: Drupalcon 2009 Flash and Drupal

How Drupal handles Flash RPC…

• Services module comes with “external” API’s so that Flash can get Drupal data.

Page 28: Drupalcon 2009 Flash and Drupal

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…

Page 29: Drupalcon 2009 Flash and Drupal

Connecting to Drupal

• Flash must first establish a connection with Drupal.

• Drupal manages the Flash connection using Session ID’s

Page 30: Drupalcon 2009 Flash and Drupal

Session Handling

Page 31: Drupalcon 2009 Flash and Drupal

Session Handling

• Flash calls “system.connect”

Page 32: Drupalcon 2009 Flash and Drupal

Session Handling

• Flash calls “system.connect”• Drupal returns a valid Session ID to Flash

Page 33: Drupalcon 2009 Flash and Drupal

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.

Page 34: Drupalcon 2009 Flash and Drupal

On the Flash Side…

Page 35: Drupalcon 2009 Flash and Drupal

On the Flash Side…

• Uses NetConnection to connect to flash

Page 36: Drupalcon 2009 Flash and Drupal

On the Flash Side…

• Uses NetConnection to connect to flash

• Create responder to handle callbacks

Page 37: Drupalcon 2009 Flash and Drupal

On the Flash Side…

• Uses NetConnection to connect to flash

• Create responder to handle callbacks

• Make the Service Call

Page 38: Drupalcon 2009 Flash and Drupal

Drupals response is handled using callback functions

Page 39: Drupalcon 2009 Flash and Drupal

Asynchronous Programming

Page 40: Drupalcon 2009 Flash and Drupal

Asynchronous Programming• Flash triggers actions based on events ( Event

Driven )• Events move the system along

Page 41: Drupalcon 2009 Flash and Drupal

Asynchronous Programming• Flash triggers actions based on events ( Event

Driven )• Events move the system along

Page 42: Drupalcon 2009 Flash and Drupal

Asynchronous Programming• Flash triggers actions based on events ( Event

Driven )• Events move the system along

Register for event

Page 43: Drupalcon 2009 Flash and Drupal

Asynchronous Programming• Flash triggers actions based on events ( Event

Driven )• Events move the system along

Register for event

Make the call…

Page 44: Drupalcon 2009 Flash and Drupal

Asynchronous Programming• Flash triggers actions based on events ( Event

Driven )• Events move the system along

Register for event

Make the call…

Twiddle your thumbs…

Page 45: Drupalcon 2009 Flash and Drupal

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!

Page 46: Drupalcon 2009 Flash and Drupal

Let’s build something!

Page 47: Drupalcon 2009 Flash and Drupal

Let’s build something!

Meet my wife…

Page 48: Drupalcon 2009 Flash and Drupal

Let’s build something!

Meet my wife…

Page 49: Drupalcon 2009 Flash and Drupal

Let’s build something!

Meet my wife… She is Flash…

Page 50: Drupalcon 2009 Flash and Drupal

Let’s build something!

Meet me…

Page 51: Drupalcon 2009 Flash and Drupal

Let’s build something!

Meet me…

Page 52: Drupalcon 2009 Flash and Drupal

Let’s build something!

Meet me… I am Drupal…

Page 53: Drupalcon 2009 Flash and Drupal

Demo Time!

Page 54: Drupalcon 2009 Flash and Drupal

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…

Page 55: Drupalcon 2009 Flash and Drupal

Questions?