Manual

11
Developer’s guide - C++, Urbi, Flex, Java - V2.0
robopec
This document is the property of Robopec. The information contained herein may not be used, reproduced or
communicated without its prior written consent.
4.3 Flex Stand-alone Application
A stand-alone application is an AIR application on which you add classic order’s dispatch features to
Reeti using the class "communication" in the library PublicGUITools provided on Reeti.
Be careful, class communication can only be used locally on AIR and Reeti. The use of class
communication in a Flash or AIR project on another machine than Reeti is currently not
supported and will not work.
Steps to create a fully Reeti compatible application are the following:
- Create a <s:WindowedApplication>
- In <fx:Script> , declare an instance of communication class :
o private var com:Communication;
- After the creation of the application, instantiate your object:
o com = Communication.getInstance(0);
Communication class is a singleton, getInstance is the only way to instantiate it
correctly.
- Communication will try to establish and a EventDataReception event will be emitted. You
can get back it thanks to :
o com.addEventListener("connection", changeConnection);
If message is 0, connection is not done.
If message is 1, connection is established.
If message is 2, connection failed.
- Use the « com » object to communicate with Reeti using:
o com.write("order_for_reeti");
Example:
<!--Initialization -->
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
applicationComplete="creationCompleteHandler()"
xmlns:components="components.*"
>
<fx:Script>
<![CDATA[
//We declare a communication available just from this component
private var com:Communication;
//Callback on end of application initialization
public function creationCompleteHandler():void