quick AS Q
- Started
- Last post
- 22 Responses
- stewart
i use this to load an external txt document into flash:
http://pastebin.coconut.se/?id=3…
but somehow it doesn't render the text as html.
it is going okay when i use the same textfield with this line of AS:this.loadVariables("myfile.txt...
any suggestions?
btw, the "render text as html" thing is checked.
- Solid0
Did you try:
scroller.htmlText = this.text;
header.htmlText = this.header;instead of:
scroller.text = this.text;
header.text = this.header;
- Solid0
.. assuming "scroller" and "header" are dynamic textFields ..
- stewart0
thanks Solid,
but when i do it your way, all the text between the bold/italic etc tags is completely gone when i run the swf file. (?)
- UndoUndo0
flash can't understand all tags so you have to check they are supported. i.e flash likes but not .
does that help? the help files list all supported tags
- unfittoprint0
no problem if you're using device fonts
or
if you're using regular fonts you should click the italic/bold style in your library font symbol properties.
or
if you're using a pixel font you should use a search/replace [aka in Flash as split/join] to replace the italic/bold tags with font tags.
Withing those font tags, a face attribute will target an italic/bold version of that pixel font [as along as it is also a font symbol].
- Solid0
Hmmm .. it works for me .. ?
---------------
in "textfile.txt":textfield=Hello World!;
---------------
Actionscript:loadText = new LoadVars();
loadText.load("textfile.txt");
loadText.onLoad = function() {
scroller.htmlText = this.textfield;
}---------------
Stage:dynamic textfield named: "scroller", "render text as html" checkbox enabled, font set to "_sans"
- Solid0
Sorry, PVN stripped out my html tags - should read:
in "textfile.txt":
textfield=<strong>Hello< / b > <em>World< / i >!;
- UndoUndo0
looking at solid's reply and unfitto's comments it looks like font issue. first try with system fonts then add in pixel fonts as per instructions from Unfitto
- Solid0
Forgot to mention, I tested using MX2004 Pro, with pub settings: SWF version 6, AS version 1
- stewart0
oh shit.
unfit you're damn right.
i embedded a nice font, and everything worked well till i tried to add bold/italic tags and hyperlinks.
please don't tell me it's not going to work this way.
- stewart0
AAAAAHH!!
- Solid0
yea - when I test with embedded characters it doesn't work ..
- stewart0
AAAAAAAAAHHH!!!
- Solid0
Kind of makes sense actually - since your embedding a specific outline, Flash can't dynamically bold/italicize it ..
- UndoUndo0
import the fonts dynamically from an external swf. make sure you select bold and italic when you do and everything should work fine.
- Solid0
Sorry - totally missed unfittoprint's reply - he's got the right answer to your problem ;)
- stewart0
bold and italic doesn't matter.
i want the hyperlinks and the underline tags to work.
but hell, this is not going to happen.
- Solid0
what font[s] are you using?
- stewart0
avenir
regular
medium
heavy
- Solid0
Have you made library symbols of all three?