Groups

Group Admins
  • camille
  • ariels

amfPHP Users

Public Group  |  active 2 weeks, 5 days ago ago

amfPHP users questions and answers

Viewing post 1 to 4 (4 total posts)

Send object from Flash to amfPHP

  • Rob

    said

    I’m a noob, trying to send an object from Flash to amfPHP 2.0.1. If I send a simple string there are no problems, but when I try to send a “complex” object to amfPHP, I get the dreaded “NetConnection.Call.BadVersion” error.

    I’ve read the documentation multiple times and, quite frankly, it could use some serious improvement, so I hope someone on the forum can help.

    Following is my very simple ActionScript and PHP code in its entirety. What am I doing wrong here?

    ===== ActionScript Code =====
    package
    {
    import flash.display.*;
    import flash.net.*;

    public class AMFPHPTest extends Sprite
    {
    private var netConnection:NetConnection;

    public function AMFPHPTest()
    {
    var movieObject:Object = new Object();
    movieObject.movie = “Aliens”;

    netConnection = new NetConnection();
    netConnection.connect(“http://localhost/web/amf/AmfPHP/”);
    netConnection.call(“Init/launchApp”, new Responder(onResult, onFault), movieObject);
    }

    private function onResult(response:Object):void
    {
    if (response.hasOwnProperty(“response”))
    {
    trace(“Now you’re cooking…”);
    }
    }

    private function onFault(response:Object):void
    {
    trace(“Got a fault…”);
    }
    }
    }

    ===== PHP Code =====
    response = $responseString;
    }
    }

    ?>

  • Rob

    said

    Well, since my PHP code got cut off by this shitty forum, here’s the PHP code without the php tags:

    class Init
    {
    public function launchApp($movieObject)
    {
    if (strcmp($movieObject['movie'], ‘Aliens’) == 0)
    return new ResponseObject(‘Your favorite movie…’);
    else
    return new ResponseObject(‘Not your favorite movie…’);
    }
    }

    class ResponseObject
    {
    public $response;

    public function __construct($responseString)
    {
    $this->response = $responseString;
    }
    }

  • Rob

    said

    By the way, can anyone recommend an alternative to amfPHP? I’m about ready to give up on this shit.

Viewing post 1 to 4 (4 total posts)

Who’s Online

There are no users currently online

Groups