Let Flash use WordPress content

24. November 2008 · Thema: Flash & ActionScript 3.0, PHP

Last week I set up a fresh WordPress system for a client to function as a Content Managament System.
This week I am trying to load content that is managed and stored by WordPress in to a Flash front-end.Currently our client has a Flash application running on the frontpage of his site which allow a user to browse content (that’s also available as html) in an appealing way. Currently this Flash application gets it’s content from a static .xml file.

But now that the new site uses WordPress as a CMS tool, it’s time to rewrite this (static) Flash application so it loads categories and related posts from WordPress and display it in a more dynamic way.

Goal
Here is a quick list of things I want to achieve:

  1. The Flash application outputs all categories (except for the standard ‘Uncategorized’ category)
  2. For every category flash retrieves the five most recent posts (including custom key value pairs defined within WordPress)
  3. The Flash application cycles through all the different categories and posts inside those categories, displaying photos and/or video which are defined by using the Custom Fields feature in WP.

The Front-End
For the front-end, this is how I set up my project:

  1. A Actionscript 3.0 only project set up using Flex Builder 3.
  2. Using Flash CS4 to create all my visual assets and export those as .SWC components so I can import them into my AS3 project.
  3. The PureMVC framework for creating powerful, manageable applications.

The Back-End
Obviously for the back-end, in this case, I use WordPress. WordPress stores all it’s content in a MySQL database.

  1. WordPress comes with an XML-RPC implementation which allows you to display and manipulate content in a (custom made) client application through a set of PHP functions (API).
A Actionscript 3.0 implementation for XML-RPC is written by Daniel McLaren. See here. He rewrote Matt Shaw’s actionscript 2.0 implementation. Easy to set up and in now time you are sending and receiving xml messages from WordPress to use in your Flash application.

Tim Wilsons PressConnect
After playing a lot with the XML-RPC functionality of WordPress itself, I discovered that, just like Tim Wilson said, it’s quiet limited when it comes to displaying content.

XML-RPC focusses more on the content manipulation side. Creating and editting posts and categories.

I came across PressConnect, a simple php script for connection a Flash application to a WordPress blog.
Flash communicates with WordPress through PHP by talking in the XML language.
Actually, with PressConnect you bypass the WordPress engine and talk directly with the wp mysql database through php.

In the next update I’ll try to show some screenshots and code snippets on how PressConnect works, also in comparison to the simple XML-RPC.

Related posts:

  1. Using Wordpress as a CMS works like a charm
    This week i worked on a site development project for one of our clients. Basically the idea was to pimp...
  2. Flash CS3 Datagrid with AMFPHP
    Wade Arnold wrote an interesting article about connecting flash to a MySql database with the help of AMFPHP, flash remoting....
  3. Customizable ComboBox (Flash CS3)
    Here is an example of how to customize the font (size, style, color) for the two components List and TextField...
  4. Actionscript 3 Datastructures
    This morning I came across a interesting AS3 implementation of the common known data structures....
  5. Importing Cinema4D model into Papervision3D 2.0
    Preparing a custom made object in Cinema4D for use in Papervision Flash and importing the exported .dae into flash....

6 Comments
  1. Pingback
  2. Pingback
  1. #3 • jamie on 27.01.2009 said:
     

    made any progress on this?

  2. #4 • NRocco on 27.01.2009 said:
     

    @jamie for that project is was working on I implemented PressConnect for Flash (AS3) and WordPress (PHP) communication. I implemented missing functionalities on the serverside.
    Though i recommend not using PressConnect at all and instead use a remoting service.

    Try ZendAMF for example. Author is Wade Arnold (same author of AMFPHP ). ZendAMF is recognized and supported by Adobe, which I consider a pro.

    Here are some usefull links:
    Tutorial http://www.gotoandlearn.com/play?id=90
    Reference Guide to ZendAMF http://framework.zend.com/manual/en/zend.amf.html

  3. #5 • Reuben on 29.03.2009 said:
     

    I have just developed an AS3 wrapper for the WordPress XML-RPC API if anyone is interested in making flash front-ends for WordPress (and doesn’t have the time to build their own!)
    http://blog.absentdesign.com/?page_id=22

  4. #6 • Jonah on 26.10.2009 said:
     

    @NRocco, Thank you so much for the suggestion in your comments for ZendAMF and to Lee Brimelow’s tutorial on ZendAMF integration with Flash. After reading your suggestion, I started about an hour ago since then and I’m already pulling data into Flash! Cheers :-]

Hinterlasse einen Kommentar!

Kommentar:

Diskussion zum Beitrag als RSS 2.0 Feed abonnieren.