Flash Remoting Connection Code (ActionScript 2.0 + PHP)


Flash Remoting Connection Code (ActionScript 2.0 + PHP)

Postby Ashish on Sat Feb 07, 2009 1:14 pm

Action Script Code

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/

Ashish
 
Posts: 84
Joined: Tue Oct 14, 2008 1:49 pm

Return to Flash Remoting (AMF PHP)

Who is online

Users browsing this forum: No registered users and 1 guest

cron