- Code: Select all
import mx.remoting.*;
import mx.rpc.*;
import mx.utils.Delegate;
import mx.remoting.debug.NetDebug;
//
var ashish = new Service("http://www.flexflashforum.com/amfphp/gateway.php", null, "Remoting_slideShow");
function Results(re:ResultEvent) {
trace(re.result.userList[0].imgUrlS);
}
function Errors(fe:FaultEvent) {
trace('There has been an error');
}
function connetc() {
trace("Called...");
}
btn.onPress = function() {
trace("Calling...");
var amit:PendingCall = ashish.getUserList("5");
amit.responder = new RelayResponder(this._parent, "Results", "Errors");
};
PHP Class Code in ("amfphp\services" folder)
- Code: Select all
<?php
class Remoting_slideShow
{
function Remoting_slideShow()
{
$this->methodTable = array(
"getUserList" => array(
"description" => 'converting images from flvs',
"access" => "remote",
)
);
}
function getUserList($sid){
$userList = array();
for($i=0; $i<$sid; $i++)
{
$userList[$i] = array('imgUrlS' => 'ImagesS/'.$i.'.jpg', 'imgUrlF' => 'ImagesF/'.$i.'.jpg');
//$userList[$i] = array('imgUrl' => 'Images/'.$i.'.jpg');
}
//return $userList;
$obj = (object) $obj;
$obj-> swfName = "Remoting Connected ... ";
$obj-> userList =$userList;
return $obj;
}
}
?>
Also See: amfphp/browser/
