Mike Potter

May 15, 2006

Passing Parameters from Flex to AMFPHP

I had an email the other day from a developer who was wondering how to pass PHP parameters via ActionScript. The answer is very simple... Let's take a look at some sample code from my PHP Gallery / Flex project:

public function getPhotosForAlbum( AlbumID:int ) : void
{
gateway = new RemotingConnection( "http://localhost/amfphp/gateway.php" );
gateway.call( "embededGallery.getPhotos", new Responder(onResultGetPhotosForAlbum, onFault), AlbumID);
}

You can see in this ActionScript code that the AlbumID is being passed to the "getPhotos" AMFPHP call. So easy, just add the parameters to the end of the RemotingConnection call, as a 3rd parameter.

Hope that helps some of you out!

Posted by at 8:58 PM on May 15, 2006

Comments

Jeff Bergamotto — 1:52 PM on May 20, 2006

I am having problems running my AMFPHP program with FLEX2 Beta 3. It works when I run the server on one machine and the swf on the other. But if I run both on the local host I get an Error#2028 Local Untrusted File. I am using the mxmlc on my MAC and the compilation is fine. It only produces a SWF file, no html.

NetConnection Network Error Listeners — 2:23 PM on June 5, 2006

How do I listen for errors other than a fault, ex network error ?

I added listeners ioError and netStatus to NetConnection and nothing happens.

thanks in advance.

Thank you for signing in, You may now comment. (Sign Out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Add your comments

Remember Me?

(You may use HTML tags for style.)

Copyright © 2009 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).