Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 06:41
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Flash Remoting with AMF (Moderators: Flash-db, Musicman, Jorge Solis, papachan, nothingGrinder)
| | |-+  Issue with TestPerson Remoting Example
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Issue with TestPerson Remoting Example  (Read 2284 times)
AndyGMD
Server what's that
*
Posts: 2


View Profile Email
« on: 03/17/09, 11:20 »

Hi,

I am using Flash CS4 and have plugged in your TestPerson example from your pages. I have amfphp working and successfully got the SimplePerson example to work for me.

There is one issue I have with TestPerson. The error I get is this when testing the flash movie from CS4:

Argument 1 passed to TestPerson::savePerson() must be an instance of Person, array given

I verified this was the case by changing the function param to just $p (from Person $p) which allowed the remoting example to work, I dumped (traced) the contents of $p and it is an array with its elements being the members of the flash Person class that was passed, followed by the package name com.flashdb.Person.

I could then use the array to call the Person() constructor, but I think I am missing something because I seem to be the only person seeing this issue. I searched the forums here and found one person reporting a similar error, but in their case they had not put the Person.php class in the right place and I know my Person.php is working (because it successfully saves/loads data after I made the array changes).

I am new to remoting and your examples and tutorials have helped me understand quite a bit, but I'd like to figure out why I get an error that others do not seem to be getting...

Any help would be greatly appreciated!

-Andy
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #1 on: 03/17/09, 16:52 »

Typed parameters begins with PHP 5, previous versions will work with untyped arrays

Jorge
Logged

AndyGMD
Server what's that
*
Posts: 2


View Profile Email
« Reply #2 on: 03/17/09, 19:45 »

Jorge, I tried it on two different webservers, one was compiled with PHP 5 (specifically 5.2.3), the other with an older PHP 4 version, but both gave me the same error until I removed that Person type specifier for the function parameter.

It doesn't really matter to me because I can use it as is by converting the assoc. array to the object before processing it, but I was curious as to why I was seeing that error.

Thanks!
Andy
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!