MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Betriebsanweisung Seite 247

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 256
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 246
Create the Flex application 247
Import the required ActionScript classes
In this section, you create a script block and import a set of classes that you will use.
1. Create a script block for ActionScript code directly below the <mx:Application> tag:
<mx:Script>
<![CDATA[
]]>
</mx:Script>
2.
Directly below the <![CDATA[ tag, add the following ActionScript import statements:
import mx.messaging.events.*;
import mx.messaging.Producer;
import mx.messaging.messages.AsyncMessage;
3.
Save the file.
Create the Producer and Consumer
In this section, you declare the variables for the message Producer and the message Consumer.
1. Directly below the import statements in the script block, add the following variable
definition:
public var pro:mx.messaging.Producer;
public var con:mx.messaging.Consumer;
2.
Save the file.
Initialize the application
In this section, you create a function to create the message Producer.
1. Directly under the variable declaration, add the following method:
public function initApp():void {
pro = new mx.messaging.Producer();
pro.destination = "ColdFusionGateway";
consumer.subscribe();
}
2.
Save the file.
Seitenansicht 246
1 2 ... 242 243 244 245 246 247 248 249 250 251 252 ... 255 256

Kommentare zu diesen Handbüchern

Keine Kommentare