Install & Test AMFPHP 1.9

Tutorials about actionscript 3 and flex.

Install & Test AMFPHP 1.9

Postby admin on Mon May 19, 2008 8:20 am

1. Download and install AMFPHP 1.9
First download AMFPHP 1.9 and unzip into your root webfolder (for example http://localhost/amfphp).

2. Create your first service
Into the amfphp/services create a new folder "itutorials" where we will put our php classes.
Now, into this "itutorials" folder, create a new php file: hello.php:

Code: Select all
 
<?php
/**
* First  tutorial class
*/

class Hello
{
 
    /**
     * first simple method
     * @returns a string saying 'Hello World!'
     */

    function sayHello()
    {
        return "Hello World!";
    }
}
?>
 


The javadoc style comments used in this class, both in the class declaration and in the method declaration, will be also visible in the amfphp browser.
Amfphp browser has changed, now built with flex2 and you can explore all your services using http://localhost/amfphp/browser.

This is a screen shot of my browser having "hello.php" service selected:
Image

As you can see the browser will display both the class and method's javadoc comments. You can also test your classes methods just using the "call" button. If your method require some arguments you will see near the call button an input field for every method's argument.

3. And you are done! :)
admin
Site Admin
 
Posts: 9
Joined: Wed May 07, 2008 4:39 pm

Return to AS3/Flex Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron