Object representation in to String example:-
We can represent any kind of object in the form of string. For this purpose we have used toString() method for any kind of object. User can see that process in this example.
Example:-
|
<?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" creationComplete="init();"> <fx:Script><![CDATA[ import flashx.textLayout.formats.Float; private function init():void{ var num:Number = 97.32; var bool:Boolean = true; var currdate:Date = new Date();myText1.text = num.toString(); myText2.text = bool.toString(); myText3.text = currdate.toString(); } ]]> </fx:Script> <s:Panel width="210" height="110" title="Convert other object to String" backgroundColor="0x81B5AA"> <s:VGroup> <mx:Text id="myText1"/> <mx:Text id="myText2"/> <mx:Text id="myText3"/> </s:VGroup> </s:Panel></s:Application> |
In this example we have created three objects that's types is Number, Boolean, Date. We have used toString() method to represent these objects in to string.
Output:-

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.