From: Klaasjan T. <k.t...@mi...> - 2003-03-28 22:43:07
|
Have a look at the slightly outdated (but soon to be updated) tutorial on actionscript.org: http://www.actionscript.org/tutorials/intermediate/PHP_Remoting/index.shtml A snippet from this page: test = new Object(); test.foo = "bar"; talkback.returnArray(test); and on the PHP side: function returnArray ($in) { $objVal = $in['foo']; return array("result"=>"Your Object contained the value $objVal"); } So yes, you can create custom AS objects and use them in PHP Klaasjan ----- Original Message ----- From: "myweb onokazu" <on...@my...> To: <amf...@li...> Sent: Friday, March 28, 2003 11:09 PM Subject: Re: [amfphp] Returning Custom Objects > How about passing a custom object as a parameter? > > for example, I have a function in PHP that expects my custom object as a > parameter: > > function myFunc(&$myObject){ > // do something with $myObject object and return something > } > > Is it possible to use this function from within the fla files? > > > > ----- Original Message ----- > From: Dv8 > To: amf...@li... > Sent: Saturday, March 29, 2003 5:37 AM > Subject: Re: [amfphp] Returning Custom Objects > > > Sweet, man! Thanks :) > ----- Original Message ----- > From: Klaasjan Tukker > To: amf...@li... > Sent: Friday, March 28, 2003 2:14 PM > Subject: Re: [amfphp] Returning Custom Objects > > > Construct an array before returning it? > > $result = array(); > $result["insid"] = $insid; > $result["name"] = $name; > $result["max"] = $max; > return $result; > > Klaasjan > ----- Original Message ----- > From: Dv8 > To: amf...@li... > Sent: Friday, March 28, 2003 8:40 PM > Subject: [amfphp] Returning Custom Objects > > > Is there any way to return custom objects? > > [example] > if (!$userid) { > mysql_query("INSERT INTO users (lastseen, username) VALUES > ($time,'$name')"); > $insid = mysql_insert_id(); > mysql_query("INSERT INTO messages (msgtime, userlink, message) VALUES > ($time,1,'[JOIN]$name')"); > > $max = mysql_result(mysql_query("SELECT max(msgid) FROM messages"),0) - > 15; > return "$insid, $name, $max"; > } > [/example] > > Instead of returning a String can I return and Array? Or an Object? > > > > ------------------------------------------------------- > This SF.net email is sponsored by: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > _______________________________________________ > amfphp-general mailing list > amf...@li... > https://lists.sourceforge.net/lists/listinfo/amfphp-general > |