Create the Flex application
The Flex application in this tutorial is a simple form in which you specify the elements of an
e-mail message, including the recipient, the sender, the subject, and the message body.
Create a new MXML file
In this section, you create an MXML file in which the layout of user interface elements is
exactly as you specify them, or absolute.
In an MXML editor, create a file that contains the following text:
1.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
layout="absolute"
creationComplete="initApp()">
</mx:Application>
Save the file as flexemail2cf.mxml. in the
2.
C:\fds2\jrun4\servers\default\samples\dataservice\myapp folder.
Create the user interface
In this section, you create the controls to enter information to send an e-mail message:
Add the following MXML code after the <mx:Application> tag:
1.
<mx:Consumer id="consumer" destination="ColdFusionGateway"
message="messageHandler(event)" />
<mx:TextInput x="103" y="13" width="291" id="emailto" editable="true"/>
<mx:TextInput x="103" y="43" width="291" id="emailfrom" editable="true"/
>
<mx:TextInput x="103" y="73" width="291" id="emailsubject"
editable="true"/>
<mx:TextArea x="103" y="102" width="291" height="236" id="emailmessage"
editable="true"/>
<mx:Label x="63" y="15" text="To:" textAlign="right"/>
<mx:Label x="37" y="103" text="Message:" textAlign="right"/>
<mx:Label x="52" y="45" text="From:"/>
<mx:Label x="37" y="75" text="Subject:"/>
<mx:Button x="402" y="13" label="Send" id="emailsend"
click="sendMessage();"/>
<mx:Label id="messagestatus" x="103" y="350" width="291" text="message
not sent yet"/>
Save the file.
2.
28
Use ColdFusion Event Gateway Adapter
Need help?
Do you have a question about the COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 and is the answer not in the manual?