I tried sending an objec and I also tried sending a single array but no use! :(
On Sun, Mar 22, 2009 at 3:16 AM, Muzak <p.ginnebe...@telenet.be> wrote: > Haven't had a chance to look at the Zend remoting implementation yet. > Have you tried sending an object ? > > var params:Object = {path:"images/", ba:ba}; > NC.call("PHPClass.function", Res, params); > > Not sure about the syntax to retrieve those in PHP, as I don't do PHP :) > > // wild guess > function writeJpg($args) { > $args["path"]; > $args["ba"]; > } > > regards, > Muzak > > ----- Original Message ----- From: "Omar Fouad" <omarfouad....@gmail.com> > To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com> > Sent: Saturday, March 21, 2009 5:50 PM > Subject: [Flashcoders] Zend AMF Framework Paramaters error > > > > Hello, > > I've got some trouble with the Zend Framework (AMF) and ActionScript, in > sending multiple parameter to a PHP Function. > The user loads an image file from the local hard drive using FileReference > into the Flash Movie than I take the Image's Bitmap Data, encode it to with > JPGEncoder (CoreLib), get the byteArray of it and pass it to a PHP function > though a NetConnection Instance like this. > > Main.as - > > //ba is my byteArray from the encoder > > var NC:NetConnection = new NetConnection(); > var Res:Reponder = new Responder(onSuccess, onError); > > NC.connect(zend_amf_server); > NC.call("PHPClass.function", Res, ba); > [...] > > PHPClass.php - > > function __construct() {...} //the construct code here > > function writeJpg( $byteArray ) { > $fp = fopen('data.jpg', 'wb'); > fwrite( $fp, implode("",$byteArray)); > fclose( $fp ); > return "File Saved"; > } > > This work like a charm, the file is created I get the response. I tried to > pass another argument to the function, a path string that holds the name of > the folder to be created like this. > > Main.as - > var path:String = "images/" > NC.call("PHPClass.function", Res, ba, path); > > PhpClass.php - > > function writeJpg( $byteArray, $path ) { > $fp = fopen($path.'data.jpg', 'wb'); > fwrite( $fp, implode("",$byteArray)); > fclose( $fp ); > return "File Saved"; > } > > Apparently this does not work. in the response I get this message: > "Error #2044: Unhandled NetStatusEvent:. level=error, > code=NetConnection.Call.BadVersion > at fileUploader_fla::MainTimeline/onSave()" the image file is corrupted > and no folder is created. > > Apparently the NC.call, cannot pass more than one parameter. I've been > searching about this problem on the web and I read that this is a bug in an > older version of zendAMF, I've downloaded the latest release, restarted by > MAMP server, but I still have the same problem... > > How can this be achieved? > > Thanks. > > -- > Omar M. Fouad - Adobe Flashâ„¢ Platform Developer > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Omar M. Fouad - Adobe Flash™ Platform Developer www.omar-fouad.net Cellular: (+20) 1011.88.534 Mail: m...@omar-fouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders