What you need

To use amfphp, you need to have the following:

  • Flash MX 2004 or Flash 8 (not free)
  • Amfphp zip file (free)
  • ActionScript Remoting components (free)

You don't need to buy anything else outside of Flash to make amfphp run. In particular, just so we're clear, you don't need to shell out 1000$ for Macromedia's version of Remoting (amfphp is a drop-in replacement for that). Before you ask, yes, Macromedia doesn't mind us giving away amfphp; in fact there is an article by none other than Robert M. Hall on Devnet that focuses on amfphp.

Installing Remoting components

If you’ve never developed for Flash Remoting, you’ll need to install it as an extension to Flash 8 or MX 2004. This manual assumes that you are familiar and comfortable with Flash 8 or MX 2004 and Actionscript. You can get a 30-day trial for Flash at Macromedia and read some good tutorials on Actionscript at actionscript.org. If you have already developed using Flash Remoting, you can safely skip this section and go to Installing amfphp.

Installing the Actionscript remoting components

To get access to the Remoting classes, you first need to install an extension to Flash 8 or MX 2004. You can download the AS2 remoting components here. Double-clicking the downloaded file should install the components automatically. You will also want to download the source for the AS2 classes, listed on the same page, if you plan on using FAME to create your movies.

Getting familiar with Remoting

Included in the mxp you just downloaded are five main elements:

  • The NetConnection debugger, a Flash movie that shows the requests to and from the server. You probably want to create a shortcut to the debugger on your desktop or QuickLaunch bar. Under Windows XP, the debugger can be found under :

    C:\Documents and Settings\{Your username}\Local Settings\Application Data\Macromedia\Flash {version}\{language}\configuration\WindowSWF\NetConnection Debugger.swf
    .

    On OS X, you can find it under:

    /Users/{username}/Library/Application Support/Macromedia/Flash {version}/{language}/Configuration/WindowSWF\NetConnection Debugger.swf
  • The service browser, which allows you to browse your services and see the available methods with their corresponding arguments. The service browser is largely unused with AMFPHP, which comes with its own full-featured HTML-based service browser with features such as Actionscript generation. Nevertheless, AMFPHP is compatible with MM’s service browser, which can be accessed in the Flash IDE from Windows > Other Panels > Service Browser.
  • Help files. Press F1 to access.
  • The Remoting libraries. These are available from Windows > Others > Libraries > Remoting Classes. You will need to include the RemotingClasses and RemotingDebugClasses in the library of each movie you create. If you want to have the RemotingClasses and RemotingDebugClasses additionally available inside the Components panel, you can copy the following file:

    C:\Documents and Settings\{Your username}\Local Settings\Application Data\Macromedia\Flash {version}\{language}\configuration\Libraries\Remoting.fla

    To the configuration\Components\ folder, and reload the Components panel.
  • A connector component available under Components > Data components > RemotingConnector.

amfphp.org | Disclaimer | Conditions of use