Wordpress + Flash
Resources for the flasher who uses WordPress.
More Resources:
Flash Press (Zend Framework + Flash)
AMF PHP - Allows Flash to communicate to PHP
Flex Data Manager - Flex + PHP Mysql (CRUD)
Setting up Wordpress to communicate with Flash via XML
Using AMF and RemoteObject without services-config.xml
 

 
Email Me
What kind of application are you trying to achieve?
Forward it to them.
 
 
 
Using AMFPHP to connect WordPress to Flash
 
In the next example we'll go through the necessary steps to retrieve the latest posts from a WordPress blog using the AMFPHP library. This library which will help you exchange information between PHP and Flash, by letting you directly call methods straight from your Actionscript code.
Please follow the steps bellow to start.
1. Setup the library
 
  • Download the package from amfphp.org
  • Upload the whole folder to the root of your webserver


  • Make sure your service is working by going to 'http://yourserver.com/amfphp/browser/'. If you can see this screen, that means you are ready.

2. Create a service (php class)
 
  • Create the PHP Class and define your methods that will be called from flash, for this example will create a class called Example.php that will define the method getRecentPosts that will accept the number of posts as a parameter to retrieve the latest posts.
    Notice that we are executing a mysql query to access the WordPress table 'wp_posts'

  • Upload your created Class into the folder '/services' of your amfphp installation.

  • Test your service by going to 'http://yourserver.com/amfphp/browser/'. This panel will help you execute your method in the class to check if it's working properly before doing any flash calls.

    Notice that you can actually execute your method from this screen. Type in the parameter and call it, it will display a list of results as long as you have posts on your WordPress blog.

3. Create the flash file
 
  • Finally all we need to do is call the php method using Actionscript. Please refer to the comments on the screenshot bellow to conclude this tutorial.
 
 

For any questions: contact at swfpress.com

Flash - WordPress - PHP - Mysql - Database - AS3