1 / 9

FLASH and RPC using AMFphp

Andrew Giles. FLASH and RPC using AMFphp. What are we talking about here?. A simple integration of actionscript and php. Also integrates Flex, Javascript, Ajax, XML. The in's and out's Uses and Ideas Resources A real-time example. RPC?. Remote Procedure Call

blake-house
Download Presentation

FLASH and RPC using AMFphp

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Andrew Giles FLASH and RPC using AMFphp

  2. What are we talking about here? • A simple integration of actionscript and php. • Also integrates Flex, Javascript, Ajax, XML. • The in's and out's • Uses and Ideas • Resources • A real-time example

  3. RPC? • Remote Procedure Call • Communication between client and server by setting a callback and receiving a result. • How AMFphp does it... • Perform request • Deserialize request • Finds the corresponding remote class • Instantiates the class • Performs security checks • Calls the remote method using the specified arguments • Serializes the returned data

  4. Getting Started actionscript... • Include the required classes import mx.remoting.debug.NetDebug; import mx.remoting.*; import mx.rpc.*; NetDebug.initialize(); • Create the servicevar service:Service = new Service('http://localhost/amfphp/gateway.php', null, 'com.company.MyService'); • Create the remote methodvar pc:PendingCall = service.myMethod("arg1", {x:'myX'}); pc.responder:RelayResponder = new RelayResponder(this, "onSuccess", "onFault"); • Handle the resultfunction onSuccess(re:ResultEvent){ trace("Success!"); } function onFault(){ trace("Fudge! :("); }

  5. Getting Started php... <?php class HelloWorld { function HelloWorld() { $this->methodTable = array ( "say" => array ( "access" => "remote", "description" => "Pings back a message" ) ); } function say($sMessage) { return 'You said: ' . $sMessage; } } ?>

  6. Datatypes

  7. Example Uses and Ideas • Data Visualization • Online/Intranet CRM • Content Management Systems • RFID/Database Integration • Web Services • RSS • Dynamic Gaming Environments • Real Estate and MLS websites • Website file system automation

  8. Advantages? • Object Oriented • Real-time feedback • Consistent layouts and interactivity • Cross browser/platform compatibility • Stand-alone projector applications

  9. Resources • http://www.amfphp.org/ • http://www.sephiroth.it/ • http://www.flash-db.com/ • http://www.macromedia.com/devnet/mx/flashremoting/

More Related