Hi,
Did you look at the example in the zip file that I sent the link for
- it has CSS, linked fonts bold and link styles too:
There are 2 examples I have uploaded -
http://glenpike.co.uk/misc/css_styling.zip
Simple demonstration of loading a CSS file, some HTML text and using
fonts in the library.
http://glenpike.co.uk/misc/css_styling_shared_fonts.zip
Similar demonstration, but the main SWF loads another SWF with the
fonts in without having to share the fonts across the 2 FLA files...
Check out the first one - I think it does what you need. The
problem maybe with creating a text field at runtime, I am not 100%.
Anyway, it was so tricky getting it right from all the articles, I
made the demo's to refer back to - just never blogged it...
(You might need to install the font for the first demo), you should
not for the second...
Hope this helps - I made the instructions in the FLA...
Glen
natalia Vikhtinskaya wrote:
I am trying without css now because css works well. Here is the last
variant where I try as they recommend in the article. I need use
alpha for this html text http://www.natavi.co.uk/test/text_test.fla
2009/5/14 Karl DeSaulniers <[email protected]>:
Did you put Arial2 as a font in your css?
Sent from losPhone
On May 14, 2009, at 7:56 AM, natalia Vikhtinskaya <[email protected]>
wrote:
Thank you very much for your help
I thought that I solved problem but this is not true.
Yes I load css file as you show. I just did not show that in my
example for less code.
You coder works but I see some strange thing. If I change name in
library to any other name – Arial2 and try it with my_fmt.font =
"Arial2" flash show Times. This is a bit strange.
It looks I need embedded font because I cannot apply _alpha without
embedFonts = true.
Here is example:
http://www.natavi.co.uk/test/text_test.html
http://www.natavi.co.uk/test/text_test.fla
Both examples have _alpha=50; Result is different. Why I cannot change
alpha for the first example that show text correctly. This is a
problem that I can not fix.
2009/5/14 Karl DeSaulniers <[email protected]>:
Now this works:
// ---- start
var curText:String = "<p class=\"headline\">Different Color Headers</p>"
+ "<p>Mauris posuere iaculis lectus. Maecenas fringilla viverra libero."
+ "Aenean adipiscing massa non orci. Etiam quis lacus sed pede porttitor
dignissim.<br>"
+ "Do you like <strong><a
href=\"mailto:[email protected]\"
target=\"_blank\" class=\"bURL\">Figleaf?</a></strong><br>"
+ "Nullam malesuada leo et turpis tincidunt eleifend. Proin non eros et
mauris suscipit fringilla. In hac habitasse platea dictumst."
+ "Maecenas varius. Duis ipsum nibh, varius a, aliquet nec, ornare ac,
diam.
Nam sollicitudin bibendum elit."
+ "Sed pellentesque tincidunt mi.</p><br><br><p class=\"author\">The
Flash
Comunity is a tightly knit, very intricate part of the web</p>";
/*
//--- Ooor if you want to import your text via a text file or other
var curText:String;
loadVariables("curText.txt", this);
*/
/*
// inside curText.txt :
curText=<p class="headline">Different Color Headers</p><p>Mauris posuere
iaculis lectus. Maecenas fringilla viverra libero. Aenean adipiscing
massa
non orci. Etiam quis lacus sed pede porttitor dignissim.<br>Do you like
<strong><a href="mailto:[email protected]"
target="_blank"
class="bURL">Figleaf?</a></strong><br>Nullam malesuada leo et turpis
tincidunt eleifend. Proin non eros et mauris suscipit fringilla. In hac
habitasse platea dictumst. Maecenas varius. Duis ipsum nibh, varius a,
aliquet nec, ornare ac, diam. Nam sollicitudin bibendum elit. Sed
pellentesque tincidunt mi.</p><br><br><p class="author">The Flash
Comunity
is a tightly knit, very intricate part of the web</p>
*/
var fmt:TextFormat = new TextFormat();
fmt.font = "Arial";
fmt.color = 0x000000; // for base color without style applied
import TextField.StyleSheet;
this.createTextField("textContent", 0, 0, 20, 240, 320);
textContent.multiline = true;
textContent.wordWrap = true;
textContent.autoSize = true
textContent.selectable = false;
textContent.html = true;
textContent.setTextFormat(fmt);
var my_styleSheet:StyleSheet = new StyleSheet();
my_styleSheet.onLoad = function(success:Boolean) {
textContent.ignoreWhite = true;
if (success) {
textContent.styleSheet = my_styleSheet;
textContent.htmlText = curText;
} else {
curText = "Text not loading";
textContent.htmlText = curText;
}
};
my_styleSheet.load("flash_css.css");
// -------- end
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
On May 13, 2009, at 10:57 AM, natalia Vikhtinskaya wrote:
I found.
Solved.
here is correct code with font in library id="Arial"
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Arial";
this.createTextField("textContent", 1, 0, 0, textAreaW,
textAreaW);
var obj=this.textContent;
obj.multiline = true;
obj.wordWrap = true;
//obj.embedFonts = true; this is wrong
obj.html=true;
obj.autoSize = true;
obj.selectable = false;
obj.setTextFormat(my_fmt);
obj.styleSheet = flash_css;
obj.htmlText=curText;
Now it shows bold, italic, normal
2009/5/13 Ruy Adorno <[email protected]>:
And what about different ids and the same linkage?
natalia Vikhtinskaya wrote:
Not possible to have them with the same id.
2009/5/13 Ruy Adorno <[email protected]>:
You have to embed 2 times the same font in your library, I think you
can
use
just the same id, but you should import one as bold and another as a
simple
font.
natalia Vikhtinskaya wrote:
I solved problem with hand cursor. Still can not make text bold. If
I
check properties in library font- bold all text becomes bold.
2009/5/13 natalia Vikhtinskaya <[email protected]>:
Thank you for help, but that does not help. I added text area with
embeded Arial letters- normal and bold on stage.
2009/5/13 Karl DeSaulniers <[email protected]>:
Hi Natalia,
On May 13, 2009, at 4:26 AM, natalia Vikhtinskaya wrote:
font-family: Arial; // I have font Arial in the library with id
“Arial”.
Try placing a instance of your embeded font off stage where your
loading
your textBox.
Another problem if I have bold tags <b>some text</b> that text is
not
Try <strong>your text here</strong>
HTH
Karl DeSaulniers
Design Drumm
http://designdrumm.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders