all groups > macromedia flash flash remoting > june 2004 >
You're in the

macromedia flash flash remoting

group:

AMFPHP shortcommings


AMFPHP shortcommings bossche
6/22/2004 2:21:28 PM
macromedia flash flash remoting:
What are the shortcommings for now with AMFPHP?

Thx

Re: AMFPHP shortcommings Stephen Beattie
6/22/2004 4:48:27 PM
As far as I understand it you can't pass Complex Objects ( i.e. custom
classes ) and everything comes through as a string. Bummer.

Stephen

[quoted text, click to view]

Re: AMFPHP shortcommings willet2
6/22/2004 7:25:48 PM
You can pass objects to flash and flash will receive them as native flash
objects. Sorry about the formatting but apparently this forum doesn't allow
one to format code.

// PHP:

<?php
// ---------------------------
// class name must be the same
// as the php file name
// ---------------------------
class Test
{
// constructor function
function Test()
{
// -----------------------------------------
// the method table describes all the
// available methods for this class to flash
// and define the roles of these methods
// -----------------------------------------
$this->methodTable = array(
// name of the function
"echoData" => array(
"description" => "Returns an object to Flash",
"access" => "remote",
"arguments" => array (""),
"returns" => "array"
)
);
}
function echoData() {
$table1 = array(
"label" => "Banana",
"data" => "6"
);
$table2 = array(
"label" => "Apple",
"data" => "3"
);
$packagedData = array($table1,$table2);
return $packagedData;
}

}
?>

// AS2 Responder:

function onConfigData(rs:ResultEvent):Void{
trace("onConfigData");

mx.remoting.debug.NetDebug.trace({level:"Debug", message:"onConfigData" });

var tmpAr = new Array();

var i:Number;
for (i=0; i<=rs.result.length; i++) {
tmpAr.addItem({name:rs.result.label, price:rs.result.data});
}
results_dg.dataProvider = tmpAr;
}

AddThis Social Bookmark Button