<?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: dynamic text field bold and italic tags with embedded font problem (flash 8)</title>
	<atom:link href="http://blog.flashweb.org/archives/5/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.flashweb.org/archives/5</link>
	<description>just sharing my work</description>
	<lastBuildDate>Sat, 28 Aug 2010 06:22:07 -0400</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: z</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-480</link>
		<dc:creator>z</dc:creator>
		<pubDate>Sat, 28 Aug 2010 06:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-480</guid>
		<description>Object(root).your_txt.htmlText=&quot;&lt;b&gt;&quot;+Yourvarhere+&quot;&lt;/b&gt;&quot;;</description>
		<content:encoded><![CDATA[<p>Object(root).your_txt.htmlText=&#8221;<b>&#8220;+Yourvarhere+&#8221;</b>&#8220;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rendall</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-472</link>
		<dc:creator>Rendall</dc:creator>
		<pubDate>Mon, 28 Jun 2010 17:51:17 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-472</guid>
		<description>Also, change the embedded font of the textfield you&#039;re importing to to be the classname of the font, e.g. &#039;ClassicoRegular*&#039;</description>
		<content:encoded><![CDATA[<p>Also, change the embedded font of the textfield you&#8217;re importing to to be the classname of the font, e.g. &#8216;ClassicoRegular*&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rendall</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-471</link>
		<dc:creator>Rendall</dc:creator>
		<pubDate>Mon, 28 Jun 2010 17:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-471</guid>
		<description>For CS4+ try this:

Rightclick on your library and add the symbol for each version of the font.  e.g. if you&#039;re importing &quot;Classico&quot;, import Classico Regular and name it ClassicoRegular.  Also, check &#039;Export for Actionscript&#039;.

Then add this code anywhere, but best in the constructor of your document class: 
&lt;pre lang=&quot;actionscript3&quot;&gt;
for each (var className : String in [&quot;ClassicoRegular&quot;,&quot;ClassicoBold&quot;,&quot;ClassicoItalic&quot;,&quot;ClassicoBoldItalic&quot;]) {
var FontClass : Class = getDefinitionByName(className) as Class;
Font.registerFont(FontClass);				
}&lt;/pre&gt;

being sure to replace &quot;ClassicoRegular&quot; &amp;tc with whatever name is in the &#039;Linkage&#039; field of the font in the library.

and importing:
&lt;pre lang=&quot;actionscript3&quot;&gt;
import flash.text.Font;
import flash.utils.getDefinitionByName;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>For CS4+ try this:</p>
<p>Rightclick on your library and add the symbol for each version of the font.  e.g. if you&#8217;re importing &#8220;Classico&#8221;, import Classico Regular and name it ClassicoRegular.  Also, check &#8216;Export for Actionscript&#8217;.</p>
<p>Then add this code anywhere, but best in the constructor of your document class:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> className <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">String</span> <span style="color: #0033ff; font-weight: bold;">in</span> <span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;ClassicoRegular&quot;</span>,<span style="color: #990000;">&quot;ClassicoBold&quot;</span>,<span style="color: #990000;">&quot;ClassicoItalic&quot;</span>,<span style="color: #990000;">&quot;ClassicoBoldItalic&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> FontClass <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Class</span> = <span style="color: #004993;">getDefinitionByName</span><span style="color: #000000;">&#40;</span>className<span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Class</span>;
<span style="color: #004993;">Font</span>.<span style="color: #004993;">registerFont</span><span style="color: #000000;">&#40;</span>FontClass<span style="color: #000000;">&#41;</span>;				
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>being sure to replace &#8220;ClassicoRegular&#8221; &#038;tc with whatever name is in the &#8216;Linkage&#8217; field of the font in the library.</p>
<p>and importing:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">Font</span>;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">getDefinitionByName</span>;</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Rendall</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-470</link>
		<dc:creator>Rendall</dc:creator>
		<pubDate>Mon, 28 Jun 2010 17:45:43 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-470</guid>
		<description>For CS4+ try this:

Right-click on your library and New Font for each style of the font you need.  e.g. if you&#039;re using &quot;Classico&quot; and need to show it as bold as well, add Classico with style Regular and name it ClassicoRegular, and then add Classico with style Bold and name it ClassicoBold .  

Also, check &#039;Export for Actionscript&#039;.

&lt;pre lang=&quot;actionscript3&quot;&gt;
for each (var className : String in [&quot;ClassicoRegular&quot;,&quot;ClassicoBold&quot;,&quot;ClassicoItalic&quot;,&quot;ClassicoBoldItalic&quot;]) {
var FontClass : Class = getDefinitionByName(className) as Class;
Font.registerFont(FontClass);				
}&lt;/pre&gt;

being sure to replace &quot;ClassicoRegular&quot; &amp;tc with whatever name is in the &#039;Linkage&#039; field of the font in the library.

and importing:
&lt;pre lang=&quot;actionscript3&quot;&gt;
import flash.text.Font;
import flash.utils.getDefinitionByName;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>For CS4+ try this:</p>
<p>Right-click on your library and New Font for each style of the font you need.  e.g. if you&#8217;re using &#8220;Classico&#8221; and need to show it as bold as well, add Classico with style Regular and name it ClassicoRegular, and then add Classico with style Bold and name it ClassicoBold .  </p>
<p>Also, check &#8216;Export for Actionscript&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> className <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">String</span> <span style="color: #0033ff; font-weight: bold;">in</span> <span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;ClassicoRegular&quot;</span>,<span style="color: #990000;">&quot;ClassicoBold&quot;</span>,<span style="color: #990000;">&quot;ClassicoItalic&quot;</span>,<span style="color: #990000;">&quot;ClassicoBoldItalic&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> FontClass <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Class</span> = <span style="color: #004993;">getDefinitionByName</span><span style="color: #000000;">&#40;</span>className<span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Class</span>;
<span style="color: #004993;">Font</span>.<span style="color: #004993;">registerFont</span><span style="color: #000000;">&#40;</span>FontClass<span style="color: #000000;">&#41;</span>;				
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>being sure to replace &#8220;ClassicoRegular&#8221; &#038;tc with whatever name is in the &#8216;Linkage&#8217; field of the font in the library.</p>
<p>and importing:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">Font</span>;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">getDefinitionByName</span>;</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: scuty</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-375</link>
		<dc:creator>scuty</dc:creator>
		<pubDate>Thu, 22 Oct 2009 13:24:37 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-375</guid>
		<description>So you have the font in you library as normal, bold, italic and bold-italic. This is the key, to have the font in you library 4 times and: 
- for one font don&#039;t check anything (this is the normal font)
- for one font check just the bold
- for one font check just italic
- for one font check both bold and italic

If you do that that you should be fine. Also I&#039;m not sure about the selected font in your text box. Try both the font in your library and the actual font name from your machine. I forgot how that is done. But it would make more sense to embed the font from your library.

Try that and let me know.</description>
		<content:encoded><![CDATA[<p>So you have the font in you library as normal, bold, italic and bold-italic. This is the key, to have the font in you library 4 times and:<br />
- for one font don&#8217;t check anything (this is the normal font)<br />
- for one font check just the bold<br />
- for one font check just italic<br />
- for one font check both bold and italic</p>
<p>If you do that that you should be fine. Also I&#8217;m not sure about the selected font in your text box. Try both the font in your library and the actual font name from your machine. I forgot how that is done. But it would make more sense to embed the font from your library.</p>
<p>Try that and let me know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: magicGea</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-374</link>
		<dc:creator>magicGea</dc:creator>
		<pubDate>Thu, 22 Oct 2009 13:02:28 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-374</guid>
		<description>Thank you for your reply
I have to say I don&#039;t understand everything in this code myself, it&#039;s a part of AS associated to text box in my scroll text box that I downloaded from internet.
I did embed the font for the text box - and when I did that it stopped displaying bold and italic (it displays me only the character that is embedded for this particular text box)(I embedded italic and bold characters as well in other text boxes)

Any clue?
Thank you</description>
		<content:encoded><![CDATA[<p>Thank you for your reply<br />
I have to say I don&#8217;t understand everything in this code myself, it&#8217;s a part of AS associated to text box in my scroll text box that I downloaded from internet.<br />
I did embed the font for the text box &#8211; and when I did that it stopped displaying bold and italic (it displays me only the character that is embedded for this particular text box)(I embedded italic and bold characters as well in other text boxes)</p>
<p>Any clue?<br />
Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scuty</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-373</link>
		<dc:creator>scuty</dc:creator>
		<pubDate>Wed, 21 Oct 2009 18:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-373</guid>
		<description>@magicGea

You don&#039;t have to specify the font, flash does that for you. All you need is to embed the fonts separately with all the combinations (normal, bold, italic, bold and italic) and different names. I am not 100% sure if naming have any impact on how the text shows.

If you have an text box on the stage then you have to go and embed the font manually for the text box. Remember that this has nothing to do with the fact that you added the font in your library so you still have to select the font to embed for the text box.

I am not really sure what do you want to do with this:
myVars = new LoadVars();
myVars.onData = function(data) {
txt = data;
trace(data)
embedFonts = true;
html = true;
}
myVars.load(&quot;olaf.txt&quot;);

This lines can be set on the text box properties (so you don&#039;t need them):
embedFonts = true;
html = true;

I don&#039;t know what is this:
txt = data;
But if you want to set the text then you should do this:
txtBox.htmlText = data;
and this must be inside your onData function, so this: txtBox.htmlText = myVars.txt; does not make a lot of sense.

Hope that was helpful.</description>
		<content:encoded><![CDATA[<p>@magicGea</p>
<p>You don&#8217;t have to specify the font, flash does that for you. All you need is to embed the fonts separately with all the combinations (normal, bold, italic, bold and italic) and different names. I am not 100% sure if naming have any impact on how the text shows.</p>
<p>If you have an text box on the stage then you have to go and embed the font manually for the text box. Remember that this has nothing to do with the fact that you added the font in your library so you still have to select the font to embed for the text box.</p>
<p>I am not really sure what do you want to do with this:<br />
myVars = new LoadVars();<br />
myVars.onData = function(data) {<br />
txt = data;<br />
trace(data)<br />
embedFonts = true;<br />
html = true;<br />
}<br />
myVars.load(&#8220;olaf.txt&#8221;);</p>
<p>This lines can be set on the text box properties (so you don&#8217;t need them):<br />
embedFonts = true;<br />
html = true;</p>
<p>I don&#8217;t know what is this:<br />
txt = data;<br />
But if you want to set the text then you should do this:<br />
txtBox.htmlText = data;<br />
and this must be inside your onData function, so this: txtBox.htmlText = myVars.txt; does not make a lot of sense.</p>
<p>Hope that was helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: magicGea</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-372</link>
		<dc:creator>magicGea</dc:creator>
		<pubDate>Wed, 21 Oct 2009 15:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-372</guid>
		<description>I am struggling with this problem since few days, your example was really helpful but my project still won&#039;t display bold and italic.
I got this dynamic scrolling text field that loads external txt file (HTML formatted). The moment I embed the font I don&#039;t see bold nor italic, other tags like links, underline, font color works no problem.
So I managed to figure out that I am missing something while embedding, I followed your example but it still doesn&#039;t display me correctly - I think my action script is missing something.
Could you take a look?
-MY FONTS
Helvetica Neue:
EastA 55 Roman
EastA 75 Bold
EastA 55 Roman Oblique
- I embedded them in the library as Font1, Font2, Font3
- My AS is:
txtBox.autoSize = &quot;left&quot;
txtBox.htmlText = myVars.txt;
txtBox.setTextFormat(txt);
myVars = new LoadVars()
myVars.onData = function(data){
	txt = data
	trace(data)
	embedFonts = true;
	html = true;
}
myVars.load(&quot;olaf.txt&quot;)

I don&#039;t know where and how to say in AS (if you see in olaf.txt file &lt;b&gt;something&lt;/b&gt; display it with Font2!!!!!! etc)

Please help
Thank you
Magic</description>
		<content:encoded><![CDATA[<p>I am struggling with this problem since few days, your example was really helpful but my project still won&#8217;t display bold and italic.<br />
I got this dynamic scrolling text field that loads external txt file (HTML formatted). The moment I embed the font I don&#8217;t see bold nor italic, other tags like links, underline, font color works no problem.<br />
So I managed to figure out that I am missing something while embedding, I followed your example but it still doesn&#8217;t display me correctly &#8211; I think my action script is missing something.<br />
Could you take a look?<br />
-MY FONTS<br />
Helvetica Neue:<br />
EastA 55 Roman<br />
EastA 75 Bold<br />
EastA 55 Roman Oblique<br />
- I embedded them in the library as Font1, Font2, Font3<br />
- My AS is:<br />
txtBox.autoSize = &#8220;left&#8221;<br />
txtBox.htmlText = myVars.txt;<br />
txtBox.setTextFormat(txt);<br />
myVars = new LoadVars()<br />
myVars.onData = function(data){<br />
	txt = data<br />
	trace(data)<br />
	embedFonts = true;<br />
	html = true;<br />
}<br />
myVars.load(&#8220;olaf.txt&#8221;)</p>
<p>I don&#8217;t know where and how to say in AS (if you see in olaf.txt file <b>something</b> display it with Font2!!!!!! etc)</p>
<p>Please help<br />
Thank you<br />
Magic</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bigE</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-371</link>
		<dc:creator>bigE</dc:creator>
		<pubDate>Thu, 15 Oct 2009 14:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-371</guid>
		<description>@David FF &gt; What do you mean by &#039;you HAVE to preselect the font&#039;? I&#039;m having the same problem with one of my projects, it worked before, but now, when I republish in CS4, it doesn&#039;t work anymore :(</description>
		<content:encoded><![CDATA[<p>@David FF &gt; What do you mean by &#8216;you HAVE to preselect the font&#8217;? I&#8217;m having the same problem with one of my projects, it worked before, but now, when I republish in CS4, it doesn&#8217;t work anymore <img src='http://blog.flashweb.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gkat</title>
		<link>http://blog.flashweb.org/archives/5/comment-page-1#comment-370</link>
		<dc:creator>gkat</dc:creator>
		<pubDate>Tue, 29 Sep 2009 21:53:15 +0000</pubDate>
		<guid isPermaLink="false">http://flashweb.org/wp/?p=5#comment-370</guid>
		<description>thank you so much for putting this up. it&#039;s the little, undocumented things that were driving me crazy.</description>
		<content:encoded><![CDATA[<p>thank you so much for putting this up. it&#8217;s the little, undocumented things that were driving me crazy.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
