|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
I m a newbie of Flash MX Actionscript. I have a group of codes but I could not get any result; Could you help me to find out the problem, please?
ecatgateway.php at /home/myname/public_html/test/ include "flashservices/app/Gateway.php"; $gateway = new Gateway(); $gateway->setBaseClassPath("/home/myname/public_html/test/module/"); $gateway->service(); * category.php and categoryctl.php locate at /home/myname/public_html/test/module/ class CategoryCtl { var $entity; function CategoryCtl() { $myDBMgr = new MySQLCtl($GLOBALS['SYS_DBHOST'], $GLOBALS['SYS_DBUSER'], $GLOBALS['SYS_DBPWD'], $GLOBALS['SYS_DBNAME']); $this->entity = new Category($myDBMgr); $this->methodTable = array( "getListByParent" => array( "description" => "return a list of all categories under a certain parent", "access" => "remote", // available values are private, public, remote "roles" => "role, list", // currently inactive "arguments" => array ("parentid") ), "getName" => array( "description" => "return a name of a category", "access" => "remote", // available values are private, public, remote "roles" => "role, list", // currently inactive "arguments" => array ("nodeid") ), "getParentID" => array( "description" => "return the ID of a category's ID", "access" => "remote", // available values are private, public, remote "roles" => "role, list", // currently inactive "arguments" => array ("nodeid") ) ); } function getListByParent($parentid) { if (($parentid+0)<= 0) { $parentid = -1; } return $this->entity->listDB("parentid=".$parentid, "", ""); } function getName($nodeid) { if (($nodeid+0) <= 0) { return "Home Category"; } return "No Yet"; } function getParentID($nodeid) { return "Not Yet"; } } Actionscript in Flash MX #include "NetServices.as" #include "NetDebug.as" NetServices.setDefaultGatewayURL("http://somewhere/test/ecatgateway.php"); var myServer = NetServices.createGatewayConnection(); var categoryMgr = myServer.getService("CategoryCtl", this); function getName_Result(theResult) { trace("Got result " + theResult); } function getName_Status(theError) { tracert("Got error " + theError); } trace("Test getName"); categoryMgr.getName(-1); WHAT should I do? Thanks.
__________________
------------------------------------------ Perl Kids Kiss Perl Stanley ------------------------------------------ |
|
#2
|
||||
|
||||
|
I don't really understand your question. It would help if you were more specific, and posted less code. AMFPHP comes with a few basic examples, I would suggest trying to get those to work. Also, make sure you have the flash remoting components installed or AMFPHP won't run.
|
|
#3
|
||||
|
||||
|
Thanks for Reply
Thanks for your reply.
I have installed Flash MX Remoting Component. I can run the example provided by AMFPHP. When I ran my flash, it should be supposed to show Got Result [something...] But it just shows Test getName This implied that the remoting object cannot be retrieved. I have tested my remoting object can work alone with HTML but the flash cannot use the object. I also test ecatgateway.php and this does not show any error. so What should I do? |
|
#4
|
||||
|
||||
|
The problem was that
the file categoryctl.php did not match the case of the class CategoryCtl oh! no... |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > AMFPHP Actionscript PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|