Groups

Group Admins
  • Avatar Image
    camille
  • Avatar Image
    Ariel Sommeria-Klein

amfPHP Users

Public Group  |  active 4 months, 2 weeks ago ago

This forum is not active anymore, please ask your questions on stackoverflow

Send object from Flash to amfPHP

Viewing post 1 to 4 (4 total posts)
  • 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)

Warning!

This content
is outdated.

Discover Silex v2,
online website builder.

Upcoming Events

  1. Haxepéro #18 : Apéropen source

    October 23 @ 7:00 pm - 11:00 pm
  2. Atelier Vim #4 : Vim fait sa rentrée !

    October 27 @ 7:00 pm - 9:00 pm
  3. Haxetelier #8 : Trucs et Haxetuces

    October 29 @ 7:00 pm - 9:00 pm

Sign up for Silex Labs news by email

SilexLabs community Tweets