Flex 2 and AMFPHP

December 11th, 2005

When I connect Flex 2 and AMFPHP using the code below I get a "ReferenceError: Error #1069: Property AppendToGatewayUrl not found on flash.net.NetConnection and there is no default value".

AS3 code:

ACTIONSCRIPT:
  1. var gatewayUrl : String = "http://localhost/amfphp/gateway.php";
  2. gateway_conn = new NetConnection();
  3. gateway_conn.objectEncoding = flash.net.ObjectEncoding.AMF0;
  4. gateway_conn.connect( gatewayUrl );
  5. gateway_conn.call( "com.multispan.micro.Person.getPersons", new flash.net.Responder( onQueryResult, onQueryStatus ) );

I am using the latest AMFPHP stable build (AMFPHP 1.0 MS3).

Search for AppendToGatewayUrl in the amfphp files I see that AuthenticationFilter.php has a line where its added to the header of the AMF message. When I comment out the 2 lines of code the "AppendToGatewayUrl" error goes away.

//$outHeader = new AMFHeader("AppendToGatewayUrl", false, "?" . ini_get('session.name') . "=" . $session_id);
//$localRef->addOutgoingHeader($outHeader);

I would like to understand what the "new AMFHeader("AppendToGatewayUrl", false, "?" . ini_get('session.name') . "=" . $session_id);" does. Is it only for passing the sessionid through? any thoughts are other comments are welcome.

[update] AppendToGatewayUrl is used to take the PHP Session id and append it to the gateway url for use in your code. Not sure why it broke with Flex2, could be the new AMF format or the new flash.net.NetConnection class. I do not particular need PHP Session id's as of yet so I will live with it turned off in AMFPHP.

Entry Filed under: Adobe Flex, Flex,AMF,PHP

2 Comments Add your own

  • 1. Pete  |  2005-12-15 at 1.28 pm

    You’d need to subclass flash.net.Responder and provide an implementation of a method with the name that matches the AMF Header.

    For example:

    public function AppendToGatewayUrl(append:String):Void
    {
    // Modify the NetConnection URL with this info
    }

  • 2. Renaun Erickson’s B&hellip  |  2006-03-15 at 8.59 am

    [...] My first post here started the basis for simple Flex2 and AMFPHP. [...]

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Disclaimer: I work as a Flash/Flex Developer for Adobe Systems Incorporated. The opinions expressed here represent my own and not those of my employer.

My Amazon.com Wish List

Calendar

December 2005
S M T W T F S
« Aug   Feb »
 123
45678910
11121314151617
18192021222324
25262728293031

Most Recent Posts


Flex.org - The Directory for Flex