« Simple Email Validator | Main | Flex 2 ExternalInterface API Sample »
Setup for FlexBuilder 2 - ColdFusion adapter
Print This PostHere is what I didto get the new FlexBuilder 2 - ColdFusion adapter.
My CF server is localhost:8500 so your config could be a little different.
After following the directions from macromdeia:
To install the FlexBuilder 2-ColdFusion Adapter:
flex-services.xsd
coldfusionsamples.xml WEB-INF\flex (mine was at C:\CFusionMX7\wwwroot\WEB-INF)
Note: The WEB-INF\flex directory does not already exist.
2
3
4
5
6
7
8
9
10
11
12
<servlet-name>MessageBrokerServlet</servlet-name>
<servlet-class>coldfusion.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.messaging.MessageBrokerServlet</param-value>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/flex-services.xml</param-value>
</init-param>
<load-on-startup>14</load-on-startup>
</servlet>
2
3
4
<servlet-name>MessageBrokerServlet</servlet-name>
<url-pattern>/flex2gateway/*</url-pattern>
</servlet-mapping>
I then did the following:
Created a com folder and then a local folder within com.
I then created a cfc named TestCFC.cfc with the following code:
<cfcomponent>
<cffunction name=”getTestString” returntype=”string”>
<cfreturn “Test from ColdFusion”>
</cffunction>
</cfcomponent>
I added the following to my coldfusionsamples.xml file:
<destination id=”TestCFC”>
<properties>
<source>com.local.TestCFC</source>
<lowercase-keys>true</lowercase-keys>
</properties>
<channels>
<channel ref=”my-cfamf”/>
</channels>
</destination>
I then created an mxml file with the following code:
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.macromedia.com/2005/mxml” xmlns=”*”>
<mx:RemoteObject id=”testCFC”
destination=”TestCFC”
result=”mx.controls.Alert.show(’result = ‘ + event.result, ‘Result’)”
fault=”mx.controls.Alert.show(’error = ‘ + event.fault, ‘Error’)”/>
<mx:Canvas width=”100%” height=”100%”>
<mx:Button click=”testCFC.getTestString()” label=”Get String” />
</mx:Canvas>
</mx:Application>
Lastly I added the following to my Project -> Properties -> Flex Compiler:
Share this Post
Topics: ColdFusion Adapter, Tutorials |


![[image]](http://mowser.com/img?url=http%3A%2F%2Fassets.max.adobe.com%2Fimages%2FMAX09_D125x125.jpg)



