Without specifying a destination in an
flex-enterprise-services.xml file you have two options:
You'd could programmatically create a
mx.messaging.channels.ChannelSet in an <xm:Script> block and assign it to
the RemoteObject instance,
or you could try just specifying the endpoint attribute (in
addition to the destination attribute) on the MXML tag version of RemoteObject
to point at a CF Mystic server that hosts your CFC.
If Flex and ColdFusion are not on the same domain then you
may need to consider adding a crossdomain.xml file to your ColdFusion server
webroot (i.e. without a context root) to allow access from your Flex SWF. This
is not specific to Flex however, this is just the general sandbox security
restrictions imposed by the Flash Player.
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Rottman
Sent: Thursday, May 18, 2006 2:09 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Help with remote objects.
Also I am not using FDS, I am using the standard flex bulder 2 beta 3.
Error Screenshot
Here is my code.
testRO.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initComponent()" layout="absolute">
<mx:Script source="testRO.as" />
<mx:RemoteObject
id="getSaleMod"
showBusyCursor="true"
destination="ColdFusion" source="com.testCF! C">
<mx:method name="getSales" result="getSales_result(event)" fault="server_fault(event)" />
</mx:RemoteObject>
<mx:HBox width="100%" height="100%">
<mx:DataGrid
id="masterList"
width="100%" height="100%" top="0" left="0" right="0" bottom="0">
<mx:columns>
<mx:DataGridColumn dataField="fld_mlsNum" headerText="Fld Mls Num" />
<mx:DataGridColumn dataField="fld_propType" headerText="Fld Prop Type" />
&! nbsp; ! <mx: DataGridColumn dataField="fld_fileNum" headerText="Fld Prop Status" />
</mx:columns>
</mx:DataGrid>
</mx:HBox>
</mx:Application>
testRO.as:
// ActionScript file
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import mx.utils.ObjectUtil;
import mx.controls.Alert;
private var _key:Object;
!
[Bindable]
public function get key():Object
{
return this._key;
}
private function initComponent():void
{
refreshList(null);
}
public function refreshList(event:Event):void
! {
! &n bsp; this.getSaleMod.getSales(this.key);
}
private function getSales_result(event:ResultEvent):void
{
//Alert.show( ObjectUtil.toString(event.result) );
this.masterList.dataProvider = event.result as ArrayCollection;
}
private function server_fault(event:FaultEvent):void
&nb! sp; {
// dump error message
Alert.show( ObjectUtil.toString(event.fault) );
}
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.