September 27th, 2007 by Kyle
Tags: cfc, cfcs, cfmx7.0.2, ColdFusion, fds, Flex, Flex Builder, flex-2.0, flex-data-services, flex-sdk, flex2.0.1, host-my-site, hostmysite, hostmysite.com, mxml, remote-object, remoteobject, rpc
Posted in: ColdFusion, Flex
This post is to carry on from my previous post regarding moving data from ColdFusion CFCs to Flex 2 Applications Using Webservices.
Here is the first sample showing basic retrieval of a string via Remote Object:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" >
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
[Bindable]
public var sResult:String;
public function handleStringResult(event:ResultEvent):void{
sResult=event.result as String;
}
]]>
</mx:Script>
<mx:RemoteObject
id="myService"
destination="ColdFusion"
source="services.HelloWorld">
<mx:method name="sayHelloString" result="handleStringResult(event)" fault="Alert.show(event.fault.message)" />
</mx:RemoteObject>
<mx:Label id="lblStringResult" text="{sResult}"/>
<mx:Button label="get String Remote Object" click="myService.sayHelloString()"/>
</mx:Application>
Browse the source of this example.
Download a zipfile containing the source to this sample.
No Comments »

Recent Comments