[Flashcoders] [AMFPHP] return; - feature / bug ?
Hi, This is the situation: Flash uses AMFPHP to call a php function 'test1()' . In my php file, the function is defined as followed: function test1() { test2(); return Hello; } function test2() { return World; } Now, AMFPHP returns World (when I call test1() ), but I would expect him to return Hello (like flash would do). Is this a feature or a bug? (Or maybe just a hole in my PHP knowledge ?) Greets, Jeroen ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] [AMFPHP] return; - Feature / bug ?
Hi, This is the situation: Flash uses AMFPHP to call a php function 'test1()' . In my php file, the function is defined as followed: function test1() { test2(); return Hello; } function test2() { return World; } Now, AMFPHP returns World (when I call test1() ), but I would expect him to return Hello (like flash would do). Is this a feature or a bug? (Or maybe just a hole in my PHP knowledge ?) Greets, Jeroen ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - feature / bug ?
Jeroen Beckers schrieb: Hi, This is the situation: Flash uses AMFPHP to call a php function 'test1()' . In my php file, the function is defined as followed: function test1() { test2(); return Hello; } function test2() { return World; } Now, AMFPHP returns World (when I call test1() ), but I would expect him to return Hello (like flash would do). Is this a feature or a bug? (Or maybe just a hole in my PHP knowledge ?) seems like php returns mean to 'break' this. i'd suggest to put the retrurn of test2() into a local var. it just doesn't make sense anyway, even if it would return just 'Hello', right ? micha ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
how about: function test1() { return Hello .test2(); } in you setting the returned world makes no sence since it's not printed or put in a variable or anything (amasing that is does not give an error that way. hth, Folkert Jeroen Beckers wrote: Hi, This is the situation: Flash uses AMFPHP to call a php function 'test1()' . In my php file, the function is defined as followed: function test1() { test2(); return Hello; } function test2() { return World; } Now, AMFPHP returns World (when I call test1() ), but I would expect him to return Hello (like flash would do). Is this a feature or a bug? (Or maybe just a hole in my PHP knowledge ?) Greets, Jeroen ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
Hi Fokert :D That gives back World too... I really don't understand it :S Greets, Jeroen Ps: I'm Dauntless Folkert Hielema wrote: how about: function test1() { return Hello .test2(); } in you setting the returned world makes no sence since it's not printed or put in a variable or anything (amasing that is does not give an error that way. hth, Folkert Jeroen Beckers wrote: Hi, This is the situation: Flash uses AMFPHP to call a php function 'test1()' . In my php file, the function is defined as followed: function test1() { test2(); return Hello; } function test2() { return World; } Now, AMFPHP returns World (when I call test1() ), but I would expect him to return Hello (like flash would do). Is this a feature or a bug? (Or maybe just a hole in my PHP knowledge ?) Greets, Jeroen ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
$this-test2(); hth, Mike ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
Sorry, forgot that while copying... But it doesn't work either... Mike Britton wrote: $this-test2(); hth, Mike ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
?php class testClass { function testClass() { $this-methodTable = array( test1 = array( description=I return 'hello world', access=remote, arguments=array(), returntype=string), test2 = array( description=I return 'hello', access=remote, arguments=array(), returntype=string) ); } function test1() { return $this-test2(). world; } function test2() { return hello; } } ? html headtitle/title/head body ?php include('testClass.php'); $myTest = new testClass(); $message = $myTest-test1(); echo $message; ? /body /html Mike ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
Yes, that works... So why won't my class work? //class ?php class Quadri { /* * Constructor */ function Quadri() { include(Quadri.methodTable.php); } /** * This function adds the score name to the database * @access remote */ function insertIntoDatabase($p_score, $p_name) { return test5; } /* * This function checks and decrypts the given code from flash * @access remote */ function addScore($p_score, $p_name) { $test = $this-insertIntoDatabase(test, test); return HelloWorld!; } } ? //method table ?php $this-methodTable = array( insertIntoDatabase = array( description = This function adds the score name to the database, arguments = array(p_score, p_name), access = remote ), addScore = array( description = /\n This function checks and decrypts the given code from flash, arguments = array(p_score, p_name), access = remote ) ); ? Mike Britton wrote: ?php class testClass { function testClass() { $this-methodTable = array( test1 = array( description=I return 'hello world', access=remote, arguments=array(), returntype=string), test2 = array( description=I return 'hello', access=remote, arguments=array(), returntype=string) ); } function test1() { return $this-test2(). world; } function test2() { return hello; } } ? html headtitle/title/head body ?php include('testClass.php'); $myTest = new testClass(); $message = $myTest-test1(); echo $message; ? /body /html Mike ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
You need to create a methodTable array in the constructor of every class you're using with AMFPHP. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
I did that :). Mike Britton wrote: You need to create a methodTable array in the constructor of every class you're using with AMFPHP. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
I always put my methodTable in the constructor, not include it. This could be the source of the problem. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] [AMFPHP] return; - Feature / bug ?
It's really handy if you include it. In the service browser, you can select [mt] and 'save to XXX.methodtable.php' . Every time you edit your class, you just press the save to method table button and it's automaticly updated. And uhm... The problem is solved... I kept calling the wrong function :#. I'm really embarrassed of this... I was a little confused as to how the service browser works... (I'm new to AMFPHP). Thanks for everyones time! :) Mike Britton wrote: I always put my methodTable in the constructor, not include it. This could be the source of the problem. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com