Tuesday, November 12, 2013
flex mx:AdvancedDataGrid grouping and datagrid save
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
height="100%"
width="100%">
<fx:Script>
<![CDATA[
/*
private var _id:Number;
public var _name:String;
public function get id():Number
{
return _id;
}
public function set id(value:Number):void
{
_id = value;
}
public function get name():String
{
return _name;
}
public function set name(value:String):void
{
_name=value;
*/
import mx.collections.ArrayCollection;
[Bindable]
public var arr:ArrayCollection=new ArrayCollection();
public var emp:EmployeeDetails=new EmployeeDetails();
protected function button1_clickHandler(event:MouseEvent):void
{
/*var obj:Object=new Object();
obj.id=txt_Id.text;
obj.name=txt_Name.text;
arr.addItem(obj);
*/
emp.id=Number(txt_Id.text);
emp._name=txt_Name.text;
arr.addItem(emp);
button2_clickHandler(event);
}
protected function datagrid1_clickHandler(event:MouseEvent):void
{
emp=dg.selectedItem as EmployeeDetails;
if (emp != null)
{
txt_Id.text=String(emp.id);
txt_Name.text=emp.name;
}
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:HBox height="100%"
width="100%">
<mx:VBox height="100%"
width="50%"
horizontalAlign="center"
verticalAlign="middle">
<s:Form height="100%"
width="100%">
<fx:Script>
<![CDATA[
protected function button2_clickHandler(event:MouseEvent):void
{
txt_Id.text="";
txt_Name.text="";
}
]]>
</fx:Script>
<s:FormItem label="Id">
<s:TextInput id="txt_Id"
restrict="0-9"/>
</s:FormItem>
<s:FormItem label="Name">
<s:TextInput id="txt_Name"/>
</s:FormItem>
<s:FormItem>
<mx:HBox>
<s:Button label="Save"
click="button1_clickHandler(event)"/>
<s:Button label="Clear"
click="button2_clickHandler(event)"/>
</mx:HBox>
</s:FormItem>
</s:Form>
</mx:VBox>
<mx:VBox height="100%"
width="50%"
horizontalAlign="center"
verticalAlign="middle">
<s:DataGrid height="100%"
id="dg"
dataProvider="{arr}"
width="100%"
click="datagrid1_clickHandler(event)">
<s:columns>
<mx:ArrayList>
<s:GridColumn headerText="Id"
dataField="id"/>
<s:GridColumn headerText="Name"
dataField="name"/>
</mx:ArrayList>
</s:columns>
</s:DataGrid>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var dpHierarchy:ArrayCollection= new ArrayCollection([
{name:"Barbara Jennings", region: "Arizona", total:70, children:[
{detail:[{amount:5},{amount:10},{amount:20},{amount:45}]}]},
{name:"Dana Binn", region: "Arizona", total:130, children:[
{detail:[{amount:15},{amount:25},{amount:35},{amount:55}]}]},
{name:"Joe Smith", region: "California", total:229, children:[
{detail:[{amount:26},{amount:32},{amount:73},{amount:123}]}]},
{name:"Alice Treu", region: "California", total:230, children:[
{detail:[{amount:159},{amount:235},{amount:135},{amount:155}]}
]}
]);
]]>
</fx:Script>
<mx:AdvancedDataGrid id="myADG"
width="100%" height="100%"
variableRowHeight="true">
<mx:dataProvider>
<mx:HierarchicalData source="{dpHierarchy}"/>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn dataField="name" headerText="Name">
<mx:headerRenderer>
<fx:Component>
<mx:HBox horizontalAlign="center">
<s:Button label="Add Company"/>
</mx:HBox>
</fx:Component>
</mx:headerRenderer>
</mx:headerRenderer>
</mx:AdvancedDataGridColumn>
<mx:AdvancedDataGridColumn dataField="total" headerText="Total"/>
</mx:columns>
</mx:AdvancedDataGrid>
</mx:VBox>
</mx:HBox>
</s:Application>
Tuesday, November 5, 2013
Friday, October 25, 2013
Flex 4.5 Audio Recorder :) Enjoy
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow close="{PopUpManager.removePopUp(this)}" xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" cornerRadius="10" styleName="TitleWindow" width="300" height="200" title="Voice Recorder" creationComplete="init()">
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:RemoteObject id="remotePat"
showBusyCursor="true"
destination="patientSearchDestination"
fault="Alert.show('Remote Object Error')">
<s:method name="getAudioFileFromFolder"
result="getAudioFileFromFolderResult(event)"/>
</s:RemoteObject>
</fx:Declarations>
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
.TitleWindow {
borderStyle: solid;
borderAlpha: 1;
roundedBottomCorners: true;
backgroundAlpha: 0.54;
highlightAlphas: 0.46, 0.28;
backgroundColor: #FFFFFF;
titleStyleName: "mypanelTitle";
}
.mypanelTitle {
color: #ffffff;
fontFamily: Arial;
fontSize: 12;
fontWeight: bold;
}
</fx:Style>
<fx:Script>
<![CDATA[
import com.aavanor.hospaa.utils.MessageUtil;
import com.aavanor.hospaa.doctor.view.script.WAVWriter;
import flash.events.Event;
import flash.events.SampleDataEvent;
import flash.media.Microphone;
import flash.media.Sound;
import flash.utils.ByteArray;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
private var soundBytes:ByteArray = new ByteArray();
private var mySound:Sound;
private var micTimer:Timer;
import fr.kikko.lab.ShineMP3Encoder;
import mx.controls.Alert;
private var mp3encoder:ShineMP3Encoder;
private var microphone:Microphone;
private var isRecording:Boolean=false;
private var soundRecording:ByteArray;
public var careId:Number;
public var patId:Number;
[Embed("/assets/images/microphoneNew.png")]
[Bindable]
public var microPhoneIcon:Class;
private function init():void {
// Get Microphone
stop_btn.enabled = false;
this.addEventListener(KeyboardEvent.KEY_DOWN, Esc);
rec_btn.setFocus();
microphone = Microphone.getMicrophone();
microphone.rate = 44;
microphone.setSilenceLevel(0);
microphone.setUseEchoSuppression(true);
microphone.soundTransform = new SoundTransform(0,0);
microphone.setLoopBack(true);
micTimer = new Timer(100);
micTimer.addEventListener(TimerEvent.TIMER, miclevel);
micTimer.start();
}
public function Esc(eve:KeyboardEvent):void
{
if (eve.keyCode == 27)
{
PopUpManager.removePopUp(this);
}
}
private function startMicRecording():void
{
isRecording=true;
soundRecording = new ByteArray();
microphone=Microphone.getMicrophone();
microphone.rate=44;
microphone.addEventListener(SampleDataEvent.SAMPLE_DATA, gotMicData);
rec_btn.enabled = false;
stop_btn.enabled=true;
}
private function stopMicRecording():void {
isRecording=false;
microphone.removeEventListener(SampleDataEvent.SAMPLE_DATA, gotMicData);
soundRecording.position=0;
encodeToMP3(soundRecording);
rec_btn.enabled = true;
stop_btn.enabled=false;
}
private function gotMicData(micData:SampleDataEvent):void
{
soundRecording.writeBytes(micData.data);
}
private function encodeToMP3(bytes:ByteArray) : void {
var wav:WAVWriter = new WAVWriter();
wav.numOfChannels = 1;
wav.sampleBitRate = 16;
wav.samplingRate = 44100;
bytes.position = 0;
var wavData : ByteArray = new ByteArray();
wavData.endian = Endian.BIG_ENDIAN;
wav.processSamples(wavData,bytes,44100,1);
//wavData.position = 0;
(new FileReference()).save(wavData, ".mp3");
// remotePat.getAudioFileFromFolder(wavData,careId,patId);
}
private function getAudioFileFromFolderResult(evt:ResultEvent):void
{
MessageUtil.showMessage("Voice Recorded Successfully");
PopUpManager.removePopUp(this);
}
/*
private function playbackSampleHandler(event:SampleDataEvent):void {
for (var i:int = 0; i < 8192 && soundRecording.bytesAvailable > 0; i++) {
var sample:Number = soundRecording.readFloat();
event.data.writeFloat(sample);
event.data.writeFloat(sample);
}
}
private function getAudioFileFromFolderResult(evt:ResultEvent):void
{
Alert.show("success");
}
private function doPlay(e:Event):void {
soundRecording.position = 0;
mySound = new Sound();
mySound.addEventListener(SampleDataEvent.SAMPLE_DATA, playbackSampleHandler);
mySound.play();
}
*/
private function miclevel(event:TimerEvent):void {
myProgressBar.width = microphone.activityLevel * 2.5;
}
]]>
</fx:Script>
<s:VGroup height="90%" width="100%" horizontalAlign="center" verticalAlign="middle">
<!-- <s:Image source="{microPhoneIcon}" /> -->
<mx:HBox >
<s:Button label="Start" icon="@Embed('assets/images/microphoneRed.png')" id="rec_btn" click="startMicRecording()"/>
<s:Button label="Stop" id="stop_btn" icon="@Embed('assets/images/StopRecording.png')" click="stopMicRecording()" />
</mx:HBox>
</s:VGroup>
<s:Group width="100%">
<s:Rect x="21" y="104" width="250" height="18" id = "myProgressBarFrame">
<s:stroke>
<s:SolidColorStroke color="0Xaaaaaa" weight="1"/>
</s:stroke>
</s:Rect>
<s:Rect x="23" y="106" width="250" height="15" id = "myProgressBar">
<s:fill>
<s:SolidColor color="green" id="myProgressBarFill"/>
</s:fill>
</s:Rect>
</s:Group>
<!-- <mx:HBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle">
<s:Image source="{microPhoneIcon}"/>
<s:Button x="17" y="66" label="Start Recording" id="rec_btn" click="startMicRecording()"/>
<s:Button x="116" y="66" label="Stop Recording" id="stop_btn" click="stopMicRecording()" />
</mx:HBox>
<s:Rect x="21" y="104" width="250" height="18" id = "myProgressBarFrame">
<s:stroke>
<s:SolidColorStroke color="0Xaaaaaa" weight="1"/>
</s:stroke>
</s:Rect>
<s:Rect x="23" y="106" width="250" height="15" id = "myProgressBar">
<s:fill>
<s:SolidColor color="green" id="myProgressBarFill"/>
</s:fill>
</s:Rect>
-->
</s:TitleWindow>
Friday, October 11, 2013
flex 4.5 And 3 Datagrid will using popup value change
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955"
minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var arr:ArrayCollection=new ArrayCollection([{id: "1", value: "anna"}, {id: "2", value: "rajiv"}, {id: "3", value: "siva"}]);
import mx.managers.PopUpManager;
public function linkbutton1_clickHandler(event:MouseEvent):void
{
var obj:Object = dg.selectedItem as Object;
var appPop:AppPopup = new AppPopup();
appPop.abc = obj.value as String;
PopUpManager.addPopUp(appPop,this,true);
}
]]>
</fx:Script>
<mx:HBox height="100%"
width="100%">
<s:DataGrid height="100%"
id="dg"
dataProvider="{arr}"
width="100%">
<s:columns>
<mx:ArrayList>
<s:GridColumn headerText="SNo"/>
<s:GridColumn headerText="Name"
dataField="value">
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<mx:HBox height="100%" width="100%">
<mx:LinkButton label="@{data.value}" click="{outerDocument.linkbutton1_clickHandler(event)}"/>
</mx:HBox>
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
</mx:ArrayList>
</s:columns>
</s:DataGrid>
</mx:HBox>
</s:Application>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955"
minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var arr:ArrayCollection=new ArrayCollection([{id: "1", value: "anna"}, {id: "2", value: "rajiv"}, {id: "3", value: "siva"}]);
import mx.managers.PopUpManager;
public function linkbutton1_clickHandler(event:MouseEvent):void
{
var obj:Object = dg.selectedItem as Object;
var appPop:AppPopup = new AppPopup();
appPop.abc = obj.value as String;
PopUpManager.addPopUp(appPop,this,true);
}
]]>
</fx:Script>
<mx:HBox height="100%"
width="100%">
<s:DataGrid height="100%"
id="dg"
dataProvider="{arr}"
width="100%">
<s:columns>
<mx:ArrayList>
<s:GridColumn headerText="SNo"/>
<s:GridColumn headerText="Name"
dataField="value">
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<mx:HBox height="100%" width="100%">
<mx:LinkButton label="@{data.value}" click="{outerDocument.linkbutton1_clickHandler(event)}"/>
</mx:HBox>
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
</mx:ArrayList>
</s:columns>
</s:DataGrid>
</mx:HBox>
</s:Application>
======================AppPopup.mxml=======================
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow close="PopUpManager.removePopUp(this)" xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="300"
height="400">
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
public var abc:String;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:HBox height="100%" width="100%">
<s:Label text="{abc}" id="lblName"/>
</mx:HBox>
</s:TitleWindow>
Map Reverse or Key and map swap
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
public class mapSwap {
public static void main(String[] args) {
Map<Integer, String> map = new HashMap<Integer, String>();
Map<String, Integer> revMap = new HashMap<String, Integer>();
map.put(1, "value");
map.put(2, "value2");
Iterator<Entry<Integer, String>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
Entry<Integer, String> entry = iterator.next();
System.out.println(entry.getKey() + "---" + entry.getValue());
revMap.put(entry.getValue(), entry.getKey());
}
Iterator<Entry<String, Integer>> revIterator = revMap.entrySet().iterator();
while (revIterator.hasNext()) {
Entry<String, Integer>entry1 =revIterator.next();
System.out.println(entry1.getKey()+"---"+entry1.getValue());
}
}
Thursday, September 5, 2013
Dynamic Text Box in Flex
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="application1_creationCompleteHandler(event)" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx1="library://ns.adobe.com/flex/mx">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
var txt:txtbox=new txtbox();
app_Vbx.addChild(txt);
}
]]>
</mx:Script>
<mx1:VBox id="app_Vbx" height="100%" width="100%">
</mx1:VBox>
</mx:Application>
package
{
import mx.containers.HBox;
import mx.containers.VBox;
import mx.controls.Alert;
import mx.controls.Label;
import mx.controls.TextInput;
import spark.components.HGroup;
import spark.components.VGroup;
public class txtbox extends VGroup
{
public function txtbox()
{
super();
this.percentHeight = 100;
this.percentWidth = 100;
Alert.show("txtbox" );
}
override protected function createChildren():void
{
Alert.show("text" );
var hbx:HGroup = new HGroup();
var txt1:TextInput = new TextInput();
txt1.percentHeight = 75;
txt1.percentWidth = 75;
var txt2:TextInput = new TextInput();
var txt3:TextInput = new TextInput();
var lbl:Label = new Label();
lbl.text="Sample";
hbx.height = 500;
hbx.width = 500;
hbx.addElement(lbl);
hbx.addElement(txt1);
hbx.addElement(txt2);
hbx.addElement(txt3);
addElement(hbx);
}
}
}
Rich Internet Application: Apache Flex and BlazeDS Setup easy 17 steps
Apache Flex and BlazeDS configuration
Requirements:
1) Download the Latest Eclipse IDE for Java EE Developers i.e. Eclipse Indigo underhttp://www.eclipse.org/downloads/
3) Download and get installed the J2ee Server i.e. Apache Tomcat
4) Get installed Latest Flash builder
Steps:
Step 1: Extract the BlazeDs under c:\BlazeDs
Step 2: Lauch the Eclipse
Step 3: Click File → New → Project select the Dynamic Web project under the Web directory
Step 4: Click Next and choose the Project Name as HelloWorld
Step 5: Click the NewRuntime, it will show the popups of the serveradaptors in that choose the Apache Tomcat v7.0 and click Next then configure it and click finish
Step 6: Then click next and click next then it will lead to web module settings, in that check the check box Generate the Web.xml deployment descriptor and click Finish
Step 7 : Goto C:\blazeDs\WEB-INF\ copy the flex folder and paste it in your Project underWebcontent → WEB-INF, then Copy the all Jar under the C:\blazeDs\WEB-INF\libs to your libs folder Webcontent → WEB-INF → libs
Step 8: Then open the web.xml (Webcontent → WEB-INF)
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>HelloWorld</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
Replace with the below Xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>HelloWorld</display-name>
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MessageBrokerServlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
</web-app>
Step 9 : Goto Project → Properties → Java Build Path click the Source tab change the output folder locatoin to the Webcontent → WEB-INF → classes
Step 10: Create the Java class EchoService.java in package com
package com;
public class EchoService {
public String echo(String text) {
return "Server says: I received '" + text + "' from you";
}
}
Step 11: Then add the destination Remote-config.xml
<destination id="echoServiceDestination" channels="my-amf">
<properties>
<source>com.EchoService</source>
</properties>
</destination>
Then replace service-config.xml under class tag
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
check with id and replace with the above
Then replace service-config.xml under class tag
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
check with id and replace with the above
Step 12: Create the Sample index.jsp file(to avoid error while running the application) and run the server
Step 13: Create the flex project in flex builder “helloWorld”
Step 14: Select the application server type as J2EE under that select the BlazeDS then click next
- Give root folder as Your Eclipse Project Location for eg, “C:\Documents and Settings\Sudharsanan\workspace\HelloWorld\WebContent” here C:\Documents and Settings\Sudharsanan\workspace is a eclipse workspace location , HelloWorld is a Project and choose the webcontent from that
- Give the Root URL as http://localhost:8080/HelloWorld
- Give the Context Root as /HelloWorld
Step 15: Choose the OutputFolder as your wish you can redirect here C:\Documents and Settings\Sudharsanan\workspace\HelloWorld\WebContent or the new folder inside the webcontent
Step 16: open the HelloWorld.mxml and replace the code
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<mx:RemoteObject id="remoteObject"
destination="echoServiceDestination"
result="resultHandler(event);"
fault="faultHandler(event);"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
// Send the message in response to a Button click.
private function echo():void {
var text:String = ti.text;
remoteObject.echo(text);
}
// Handle the recevied message.
private function resultHandler(event:ResultEvent):void {
ta.text += "Server responded: "+ event.result + "\n";
}
// Handle a message fault.
private function faultHandler(event:FaultEvent):void {
ta.text += "Received fault: " + event.fault + "\n";
}
]]>
</fx:Script>
<s:VGroup height="100%" width="100%">
<mx:Label text="Enter a text for the server to echo"/>
<mx:TextInput id="ti" text="Hello World!"/>
<mx:Button label="Send" click="echo();"/>
<mx:TextArea id="ta" width="100" height="100"/>
</s:VGroup>
</s:Application>
Step 17: Run the Application. (Check whether your text return from the server when you click Send)
Subscribe to:
Posts (Atom)