Dear All,
Can any body please provide me a good example or Link for Object Mapping
from PHP to Flex and vice versa ?
I tried one example got it from internet but failed in getting the expected
result. I am using wamp server and copying the php files under
wamp\www\amfphp\services\AMFconnection directly and calling them and getting
channel disconnected error . If I don't use Objects It is working
perfect.Am I missing any settings? I am copying the two PHP ( Value Object
PHP and the other main PHP) files in the same directory
Value Object PHP
----------------------------
class VOUser {
var strUsername = "";
var strEmail = "";
var $_explicitType = "com.isageo.VOUser";
}
main PHP
-----------------
class User {
public function getUser() {
// Get user using fancy database connection
$objUser = new VOUser();
$objUser->strUsername = "Georges";
$objEmail->"[email protected]";
return $objUser;
}
}
FLEX Value Object
----------------------------
package com.isageo {
[RemoteClass(alias="com.isageo.VOUser")]
[Bindable]
class VOUser {
public var strUsername : String;
public var strEmail : String;
}
}
Flex Source
-----------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="init();" viewSourceURL="srcview/index.html">
<mx:RemoteObject
id="amf"
source="AMFconnection.User"
destination="amfphp">
<mx:method name="getUser"
result="onConnect( event );" />
</mx:RemoteObject>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
private function init():void {
amf.getUser.send();
}
private function onConnect( e:ResultEvent ):void {
output.text = String( e.result );
}
]]>
</mx:Script>
<mx:TextArea
id="output" />
</mx:Application>
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.