Import The Required Actionscript Classes - MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Use Manual

Table of Contents

Advertisement

Import the required ActionScript classes

In this section, you create a script block and import a set of classes that you will use.
Create a script block for ActionScript code directly below the <mx:Application> tag:
1.
<mx:Script>
<![CDATA[
]]>
</mx:Script>
Directly below the
2.
import mx.messaging.events.*;
import mx.messaging.Producer;
import mx.messaging.messages.AsyncMessage;
Save the file.
3.
Create the Producer and Consumer
In this section, you declare the variables for the message Producer and the message Consumer.
Directly below the import statements in the script block, add the following variable
1.
definition:
public var pro:mx.messaging.Producer;
public var con:mx.messaging.Consumer;
Save the file.
2.
Initialize the application
In this section, you create a function to create the message Producer.
Directly under the variable declaration, add the following method:
1.
public function initApp() {
pro = new mx.messaging.Producer();
pro.destination = "ColdFusionGateway";
consumer.subscribe();
}
Save the file.
2.
tag, add the following ActionScript import statements:
<![CDATA[
Create the Flex application
29

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents