try to understand u are not adding the textField to stage, you are adding it application which again extends the UIComponent.
try casting textField to UIComponent n then add *addChild(**txtFld** as UIComponent);* 2009/8/24 Arindam Mojumder <arindam.mojum...@gmail.com> > 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(**txtFld**);* > > } > ]]> > </mx:Script> > > <mx:RichTextEditor id="rte" width="500" height="500" > creationComplete="intRt()"/> > </mx:Application> > > > -- ---------------------------------------------------- Hissam, Flex Developer, Vantage Labs, Singapore-088806 (M)+65 90852194 --------------------------------------------------- Sent from Singapore --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---