<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: [AS 3] CSS and Flash: Adding Styles to a Text Field</title>
	<atom:link href="http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/feed/" rel="self" type="application/rss+xml" />
	<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/</link>
	<description>iPhone, Flash, Flex, AIR, &#38; Web Development</description>
	<lastBuildDate>Thu, 29 Oct 2009 10:52:09 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-1173</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sun, 25 Oct 2009 01:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-1173</guid>
		<description>I used this outside of a package and it works wonderfully.
I had been trying to use cssParse for three days before I came across you post here. I this way just makes the most sense.
Thank you thank you thank you!</description>
		<content:encoded><![CDATA[<p>I used this outside of a package and it works wonderfully.<br />
I had been trying to use cssParse for three days before I came across you post here. I this way just makes the most sense.<br />
Thank you thank you thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jayesh</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-1109</link>
		<dc:creator>jayesh</dc:creator>
		<pubDate>Wed, 19 Aug 2009 13:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-1109</guid>
		<description>how about embedded fonts? does it work the same?</description>
		<content:encoded><![CDATA[<p>how about embedded fonts? does it work the same?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin ready</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-877</link>
		<dc:creator>kevin ready</dc:creator>
		<pubDate>Sun, 29 Mar 2009 18:05:36 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-877</guid>
		<description>Hey, you have an error in your code: you wrap the SPAN contents with double quotes (&quot;) and use the same types of quotes to refer to your CLASS attribute. One or the other needs to be single quotation, or the inner needs to have \&quot;</description>
		<content:encoded><![CDATA[<p>Hey, you have an error in your code: you wrap the SPAN contents with double quotes (&#8221;) and use the same types of quotes to refer to your CLASS attribute. One or the other needs to be single quotation, or the inner needs to have \&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: montana</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-825</link>
		<dc:creator>montana</dc:creator>
		<pubDate>Fri, 13 Feb 2009 21:58:31 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-825</guid>
		<description>the htmlText stuff in flash is definitely weird for how cool it is to even be available at all...

this seems to work for me for the majority of implementations...


			public function getTextField():TextField { //defaults
				var oTextField:TextField = new TextField();
				var sCSS:String=&quot;p{display:block;align:left;font-family:Verdana;leading:6px;font-size:12px;color:#808080}&quot;;
				var oStyle:StyleSheet=new StyleSheet();
				oStyle.parseCSS(sCSS);		
				oTextField.styleSheet = oStyle; //this.oStyleSheet;
				oTextField.wordWrap = true;
				oTextField.embedFonts = true; //make sure this font is embedded in a textfield on the stage (out of view) and it will work every time. be sure to embed every glyph necessary for your application - usually basic set punctuation and latin 1 extended and such...
				return oTextField;
			} 
			/*****************************************************/



hope it helps.</description>
		<content:encoded><![CDATA[<p>the htmlText stuff in flash is definitely weird for how cool it is to even be available at all&#8230;</p>
<p>this seems to work for me for the majority of implementations&#8230;</p>
<p>			public function getTextField():TextField { //defaults<br />
				var oTextField:TextField = new TextField();<br />
				var sCSS:String=&#8221;p{display:block;align:left;font-family:Verdana;leading:6px;font-size:12px;color:#808080}&#8221;;<br />
				var oStyle:StyleSheet=new StyleSheet();<br />
				oStyle.parseCSS(sCSS);<br />
				oTextField.styleSheet = oStyle; //this.oStyleSheet;<br />
				oTextField.wordWrap = true;<br />
				oTextField.embedFonts = true; //make sure this font is embedded in a textfield on the stage (out of view) and it will work every time. be sure to embed every glyph necessary for your application &#8211; usually basic set punctuation and latin 1 extended and such&#8230;<br />
				return oTextField;<br />
			}<br />
			/*****************************************************/</p>
<p>hope it helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MikeS</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-668</link>
		<dc:creator>MikeS</dc:creator>
		<pubDate>Mon, 03 Nov 2008 18:54:13 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-668</guid>
		<description>Hey, I&#039;m having a very similar problem. I went about my a little bit differently. I&#039;m loading an external HTML and CSS. Everything checks out fine and i&#039;m not getting any errors, but it just will not format the text!

What can cause flash to ignore a stylesheet???
Thanks!!

Mike S</description>
		<content:encoded><![CDATA[<p>Hey, I&#8217;m having a very similar problem. I went about my a little bit differently. I&#8217;m loading an external HTML and CSS. Everything checks out fine and i&#8217;m not getting any errors, but it just will not format the text!</p>
<p>What can cause flash to ignore a stylesheet???<br />
Thanks!!</p>
<p>Mike S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-655</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 28 Oct 2008 14:00:51 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-655</guid>
		<description>Hey Paul, I am currently on vacation .. will be back on town on Thursday - if this issue isn&#039;t resolved at that point feel free to post another comment here or email me as a reminder - can you post your files somewhere so it can be downloaded?

Thanks, Morgan</description>
		<content:encoded><![CDATA[<p>Hey Paul, I am currently on vacation .. will be back on town on Thursday &#8211; if this issue isn&#8217;t resolved at that point feel free to post another comment here or email me as a reminder &#8211; can you post your files somewhere so it can be downloaded?</p>
<p>Thanks, Morgan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-654</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 28 Oct 2008 13:35:08 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-654</guid>
		<description>grrrr... Sorry, i don&#039;t know how to add html code here :/
I&#039;ll try again :)

...
For example (in XML file): &quot;&lt;span class=&#039;headerOne&#039;&gt;After these words comma appear&lt;/span&gt;&lt;span class=&#039;headerTwo&#039;&gt;Rest of the text.&lt;/span&gt;&quot;
...

Thanks</description>
		<content:encoded><![CDATA[<p>grrrr&#8230; Sorry, i don&#8217;t know how to add html code here :/<br />
I&#8217;ll try again <img src='http://manewc.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8230;<br />
For example (in XML file): &#8220;&lt;span class=&#8217;headerOne&#8217;&gt;After these words comma appear&lt;/span&gt;&lt;span class=&#8217;headerTwo&#8217;&gt;Rest of the text.&lt;/span&gt;&#8221;<br />
&#8230;</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-653</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 28 Oct 2008 13:22:54 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-653</guid>
		<description>Could you help me with the problem above ? 
Thanks very much</description>
		<content:encoded><![CDATA[<p>Could you help me with the problem above ?<br />
Thanks very much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-652</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 28 Oct 2008 13:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-652</guid>
		<description>Hello!
Great work!
I have a strange problem with a styled textField and a htmlText loaded from XML file. I get a comma sign in SWF after a word in span. 
For example (in XML file): &quot;After these words comma appearRest of the text.&quot;
In pure AS3 (like in your example) everything is OK.</description>
		<content:encoded><![CDATA[<p>Hello!<br />
Great work!<br />
I have a strange problem with a styled textField and a htmlText loaded from XML file. I get a comma sign in SWF after a word in span.<br />
For example (in XML file): &#8220;After these words comma appearRest of the text.&#8221;<br />
In pure AS3 (like in your example) everything is OK.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cmdrhlm</title>
		<link>http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/comment-page-1/#comment-610</link>
		<dc:creator>cmdrhlm</dc:creator>
		<pubDate>Mon, 29 Sep 2008 18:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://manewc.com/2008/03/06/as-3-css-and-flash-adding-styles-to-a-text-field/#comment-610</guid>
		<description>I can&#039;t get it to work. I&#039;ve done everything to the letter.
I don&#039;t get any error&#039;s, it simply won&#039;t apply itself, so the text comes out unformatted.
This is what I have so far.
				
				var css:StyleSheet = new StyleSheet();
				var header:Object = new Object();
				header.fontsize = 20;
				header.fontweight = &quot;bold&quot;;
				header.colour = &quot;red&quot;;
				css.setStyle(&quot;.header&quot;, header);
				
				var txtField:TextField = new TextField();
				txtField.multiline = true;
				txtField.wordWrap = true;
				txtField.styleSheet = css;
				txtField.x = 200;
				txtField.htmlText = &quot;&quot;;
				txtField.htmlText += i.getName();
				txtField.htmlText += &quot;&quot;;

Please, please, please reply. I&#039;ve tried many different ways of formatting the text, but none of them seem to stick. There must be something really basic I&#039;m missing.

-c</description>
		<content:encoded><![CDATA[<p>I can&#8217;t get it to work. I&#8217;ve done everything to the letter.<br />
I don&#8217;t get any error&#8217;s, it simply won&#8217;t apply itself, so the text comes out unformatted.<br />
This is what I have so far.</p>
<p>				var css:StyleSheet = new StyleSheet();<br />
				var header:Object = new Object();<br />
				header.fontsize = 20;<br />
				header.fontweight = &#8220;bold&#8221;;<br />
				header.colour = &#8220;red&#8221;;<br />
				css.setStyle(&#8221;.header&#8221;, header);</p>
<p>				var txtField:TextField = new TextField();<br />
				txtField.multiline = true;<br />
				txtField.wordWrap = true;<br />
				txtField.styleSheet = css;<br />
				txtField.x = 200;<br />
				txtField.htmlText = &#8220;&#8221;;<br />
				txtField.htmlText += i.getName();<br />
				txtField.htmlText += &#8220;&#8221;;</p>
<p>Please, please, please reply. I&#8217;ve tried many different ways of formatting the text, but none of them seem to stick. There must be something really basic I&#8217;m missing.</p>
<p>-c</p>
]]></content:encoded>
	</item>
</channel>
</rss>
