php代码:
<BR>/* /flashservices/services/Catalog.php */ <BR>class Catalog { <BR> var $products_array = array(); <br><br>// Constructor: Contains the list of methods available to the gateway <BR>function Catalog() { <BR> $this->methodTa<i>1本文来#源gaodai$ma#com搞$代*码*网</i><pre>搞代gaodaima码
ble = array (
“getProducts” => array (
“description” => “Get list of products”,
“access” => “remote”,
“arguments” => “” // arguments could be optional, not tested
)
); // end methodTable
}
function getProducts() {
// your code goes here
return $this->products_array;
}
}
actionscript代码:
<BR>#include "NetServices.as" <BR>NetServices.setDefaultGatewayUrl("http://yourserver.com/flashservices/gateway.php"); <BR>gw = NetServices.createGatewayConnection(); <BR>CatalogREMOTE = gw.getService("Catalog", this); <BR>CatalogREMOTE.getProducts(); <br><br>getProducts_Result = function(result) { <BR> _root.products_results = result; <BR>} <BR>