Dynamic Object oriented Rapid development 1
What is Flash? Byte code is interpreted by VM in Flash Player Actionscript code is compiled to byte code AS2 Flash Player 7+, Flash Player Lite AS3 Flash Player 9+ http://www.adobe.com/products/flashplayer/ 2
What is Flex? Flex is a framework for developing RIA apps AS3 / Flash Player 9+ Collection of useful classes Pre compiler with support for mxml Open source http://flex.org/ http://www.adobe.com/products/flex/ Flex API 3
What is Air? Flash player for the desktop File system access Native window decoration Built in WebKit HTML renderer Extends Flex http://www.adobe.com/products/air/ 4
Talking to the server All Flash Players support URLRequest class Async req/resp with plain text, XML, JSON... AS2 Players support NetConnection class AMF remoting packets AS3 Players support RemoteObject class Additional remoting features 5
What is AMF? Adobe Messaging Format Binary object serialization format AMF0 works with AS2 players AMF0 spec AMF3 works with AS3 players AMF3 spec More compact 6
AMF Features Compact format Serialized/Deserialized by native code in the player Built in types Typed and un typed objects Object references AMF3 also has string and class references 7
AMF Example Python: {'spam': 'eggs'} AMF3 \x0a\x0b\x01 \x09spam \x06\x09eggs \x01 8
AMF Packets Packets are encoded in AMF0 Headers and messages may be encoded in AMF0 or AMF3 <packet> <target>string</target> <response>string</response> <headers /> <messages> <remoteobject /> </messages> </packet> 9
RemoteObject Features Automates RPC calls Can switch 'channels' Transparently switch between AMF, SOAP, etc. 10
RemoteObject Example 11
AMF packages for Python PyAmf AmFast my package!! Django AMF 12
PyAmf Thijs Triemstra and Nick Joyce Most mature / biggest community Pure Python Supports custom class mapping Supports NetConnection and RemoteObject Built in WSGI gateway Supports: Django, Google App Engine, SQLAlchemy Examples for major frameworks 13
PyAmf cont. Slow for large object graphs Not very customizable 14
PyAmf Example 15
AmFast Extension written with Python C API ~18x faster than PyAmf Alpha / no community yet Supports custom class mapping Supports NetConnection and RemoteObject Supports SQLAlchemy Example project 16
AmFast cont. Calls methods on user supplied Python objects to allow for complete customization Not as much functionality built in as PyAmf, but it's easier to add additional features Exposes packet, header, and messages objects to callable targets 17
AmFast Example 18
What is RTMP? Real Time Messaging Protocol Alternative to HTTP Used by expensive Adobe Live Cycle Data Services server Supports push to client Java's BlazeDS does not support RTMP, but it fakes push by supporting a HTTP polling interface 19
RTMP in Python RTMPy Twisted protocol Still in development, but looks promising Developed by the 2 main developers of PyAmf None of the Python AMF packages currently support psuedo push through polling, but should be easy to add to AmFast. 20
Blog Visit my blog: limscoder.blogspot.com for copies of these slides and updates about Flash and Python 21