Hello

I need to update my button label in Xml node while clicking the itz
working fine ,

and similarly i want to update the text when ever am enter in the text
filed

Plz check the sample code

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
initialize="Generatexml(event)" layout="absolute">
        <mx:Script>
                <![CDATA[
                        import mx.controls.Text;
                        import mx.controls.TextInput;
                        import mx.binding.utils.BindingUtils;
          [Bindable]public static var  gen_xml:XML;
      [Bindable]public var xmlStr:String=new String;
      [Bindable]public var text2:TextInput=new TextInput;
      [Bindable]public var text1:TextInput = new TextInput();
      [Bindable]public var text3:TextInput = new TextInput();
          public function Generatexml(event:Event):void
          {
            gen_xml = <m:math xmlns:m='http://www.w3.org/1998/Math/
MathML'></
m:math>;
        var mtext:String = "mtext";
        text1.text=ta.text;
        var xmlList:XMLList = XMLList("<"+mtext+"> "+text1.text+"
</"+mtext+">");
        gen_xml.appendChild(xmlList);
        xmlStr=gen_xml;
          }
          public function minus(event:Event):void
          {
                var minus:String= "mo";
                var text:String="-";
                var mtext:String="mtext";
                text2.text=tex.text;
                var xmlList:XMLList=XMLList("<"+minus+">"+text
+"</"+minus+">
<"+mtext+">"+text2.text+"</"+mtext+">");
        gen_xml.appendChild(xmlList);
        xmlStr=gen_xml;
          }
          public function plus(event:Event):void
          {
                var plus:String= "mo";
                var text:String="+";
                var mtext:String="mtext";
                text3.text=te.text;
                var xmlList:XMLList=XMLList("<"+plus+">"+text+"</"+plus
+"> <"+mtext
+">"+text3.text+"</"+mtext+">");
        gen_xml.appendChild(xmlList);
        xmlStr=gen_xml;
          }

          public function change2(event:Event):void
          {
                text2.text=te.text;
          }
          public function change3(event:Event):void
          {
                text3.text=te.text;
          }
        ]]>
        </mx:Script>
<mx:Canvas id="maincan" width="500" height="500">
        <mx:TextArea  text="sinx" id="ta" x="10" y="226" width="336"
height="79"/>
    <mx:TextArea change="change2(event);" text="..." id="tex" x="21"/>
    <mx:TextArea change="change3(event);" text="..." id="te" x="233"/>
<mx:Canvas x="25" y="52">
    <mx:TextArea id="ta1" text="{xmlStr.toString()}" width="348"
height="143" x="54" y="10"/>
</mx:Canvas>
        <mx:Button label="+" click="plus(event);" x="178" y="369"/>
        <mx:Button label="-" click="minus(event);" x="80" y="355"/>
</mx:Canvas>
</mx:Application>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to