I've forwarded it on for bug checking -----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: Saturday, April 15, 2006 3:51 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] beta 2: possible styleSheet bug with Text and TextArea component
When setting a styleSheet of a Text or TextArea component I get the following errors when assigning text to the htmlText property: IllegalOperationError: Error #2009: This method cannot be used on a text field with a style sheet. at mx.core::UITextField/validateNow() at mx.core::UITextField/set text() at mx.controls::Label/mx.controls:Label::commitProperties() at mx.controls::Text/mx.controls:Text::commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/::doPhasedInstantiation() at mx.core::UIComponent/::callLaterDispatcher2() at mx.core::UIComponent/::callLaterDispatcher() IllegalOperationError: Error #2009: This method cannot be used on a text field with a style sheet. at mx.core::UITextField/validateNow() at mx.core::UIComponent/::callLaterDispatcher2() at mx.core::UIComponent/::callLaterDispatcher() In this case, <mx:Text> is inside a repeater component and the stylesheet is applied when data is received from a webservice call. import flash.text.StyleSheet; // private var article_ss:StyleSheet; private function initBlogPanel():void { this.article_ss = new StyleSheet(); this.article_ss.setStyle("a", {color:"#99FF00"}); } private function getBlogItemsResultHandler(evt:ResultEvent):void { var result:ArrayCollection = new ArrayCollection(evt.result as Array); // note: at this time, the repeater has already executed // loop through recordset and assign stylesheet to text var len:uint = result.length; var _txt:Text; for(var i:uint = 0; i<len ;i++) { _txt = articleText_txt[i]; _txt.styleSheet = this.article_ss; } } <mx:Repeater id="blog_rep" width="100%" height="100%" dataProvider="{blog_ws.getBlogItems.result}" repeatEnd="blogRepRepeatEndHandler(event);"> <mx:Text id="articleText_txt" width="100%" htmlText="{blog_rep.currentItem.BLOGSHORTTEXT}"/> </mx:Repeater> I also noticed that the repeaterEnd event (of the Repeater component) is triggered *before* the result event of the webservice method call. That doesn't seem right to me. I'd expect the result event to be invoked before the repeater executes. regards, Muzak -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/