I understand your point, but why can't I add the textField in stage by writing in the below way.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import mx.containers.*; import mx.controls.*; import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; public var txtFld:TextField; public function intRt():void{ txtFld= new TextField(); txtFld.autoSize = TextFieldAutoSize.LEFT; txtFld.background = true; txtFld.border = true; txtFld.text="vcdihsvidshv eveir bveurvb"; txtFld.autoSize="true"; var format:TextFormat = new TextFormat(); format.font = "Verdana"; format.color = 0xFF0000; format.size = 10; format.underline = true; * txtFld.defaultTextFormat = format; addChild(txt);* } ]]> </mx:Script> <mx:RichTextEditor id="rte" width="500" height="500" creationComplete="intRt()"/> </mx:Application> 2009/8/24 HISSAM <hissam.sher...@gmail.com> > > TextField extends in the following manner > > TextField -> InteractiveObject -> DisplayObject -> EventDispatcher -> > Object > > *RichTextEditor is an UIComponent and will add child which are > UIComponents. > > so its not adding > * > 2009/8/24 Arindam Mojumder <arindam.mojum...@gmail.com> > > Hello All, >> >> I am very much confused with this problem and couldn't find out any >> solution. >> Whenever I am trying to add a *TextField *object into a* RichTextEditor, >> *it not showing, but when I am applying the same method to add a button >> it is working fine. >> Even I can't add a TextField in to the stage also. >> >> *Adding TextField:* (Not working) >> >> <?xml version="1.0" encoding="utf-8"?> >> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> >> <mx:Script> >> <![CDATA[ >> >> import mx.containers.*; >> import mx.controls.*; >> import flash.display.Sprite; >> import flash.text.TextField; >> import flash.text.TextFieldAutoSize; >> import flash.text.TextFormat; >> >> >> >> public var txtFld:TextField; >> >> >> public function intRt():void{ >> >> txtFld= new TextField(); >> txtFld.autoSize = TextFieldAutoSize.LEFT; >> txtFld.background = true; >> txtFld.border = true; >> txtFld.text="vcdihsvidshv eveir bveurvb"; >> txtFld.autoSize="true"; >> >> >> var format:TextFormat = new TextFormat(); >> format.font = "Verdana"; >> format.color = 0xFF0000; >> format.size = 10; >> format.underline = true; >> * >> txtFld.defaultTextFormat = format; >> >> rte.toolbar.addChild(txt);* >> >> } >> ]]> >> </mx:Script> >> >> <mx:RichTextEditor id="rte" width="500" height="500" >> creationComplete="intRt()"/> >> </mx:Application> >> >> >> >> >> >> *Adding Button: (Working)* >> >> <?xml version="1.0" encoding="utf-8"?> >> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> >> <mx:Script> >> <![CDATA[ >> >> import mx.containers.*; >> import mx.controls.*; >> import flash.display.Sprite; >> import flash.text.TextField; >> import flash.text.TextFieldAutoSize; >> import flash.text.TextFormat; >> >> public function intRt():void{ >> >> * var but:Button = new Button(); >> but.label = 'Post News'; >> rte.toolbar.addChild(but);* >> >> >> } >> ]]> >> </mx:Script> >> >> <mx:RichTextEditor id="rte" width="500" height="500" >> creationComplete="intRt()"/> >> </mx:Application> >> >> >> *Can anyone explain this problem and solve it?* >> >> >> >> >> @rindam >> >> >> >> > > > -- > ---------------------------------------------------- > Hissam, > Flex Developer, > Vantage Labs, > Singapore-088806 > (M)+65 90852194 > --------------------------------------------------- > > > > -- @rindam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to flex_india@googlegroups.com To unsubscribe from this group, send email to flex_india+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---