Hey sweet peeps,
In kirupa’s tutorial about making a scrolling text block, you enter the text to be displayed as one line inside an actionscript window.
This works fantastically well, but how do you format it? I’ve noticed returns are “/r” but what about italics or tabs?
Thanks in advance,
t2d
system
February 4, 2003, 8:01pm
3
I’ve not seen the tute, but I think you should be able to use most html formating tags. I’m sure I’ve seen a thread on this before. Try searching for ‘dynamic text’ and ‘html’
Hope this is some help:)
system
February 4, 2003, 8:24pm
4
system
February 4, 2003, 8:57pm
5
usage
myTextFormat = new TextFormat()
myTextFormat.bold = true
myTextField.setTextFormat(myTextFormat)
properties
TextFormat.align Indicates the alignment of a paragraph
TextFormat.blockIndent Indicates the block indentation in points
TextFormat.bold Indicates whether text is boldface
TextFormat.bullet Indicates whether or not text is in a bulleted list
TextFormat.color Indicates the color of text
TextFormat.font Indicates the font name of the text with a text format
TextFormat.indent Indicates the indentation from the left margin to the first character in the paragraph
TextFormat.italic Indicates whether text is italicized
TextFormat.leading Indicates the amount of leading vertical space between lines
TextFormat.leftMargin Indicates the left margin of the paragraph
TextFormat.rightMargin Indicates the right margin of the paragraph
TextFormat.tabStops Specifies custom tab stops
TextFormat.target Indicates the window in a browser where a hyperlink is displayed
TextFormat.size Indicates the point size of text.
TextFormat.underline Indicates whether text is underlined
TextFormat.url Indicates the URL to which the text links
system
February 4, 2003, 10:37pm
6
Thanks folks. I don’t really know too much about dynamic text yet but I’ll give these a looking into.
thanks, merci, gracias, arigatou, danke
t2d
system
February 5, 2003, 12:45am
7
I don’t understand this:
myLoadVars = new LoadVars();
myLoadVars.onLoad = function(success) {
if (success) {
texti = unescape(this);
myTextBox.html = true;
myTextBox.htmlText = texti.substring(0, texti.lastIndexOf("&"));
} else {
trace(“Error Loading file…”);
}
};
myLoadVars.load(“textfile.txt”);
Where does this code go? Just anywhere in the same movie as the scrolling text bar?
What do I name my text box variable?
Is “textfile.txt” the external text file?
I can’t get this to work.
kax, I don’t know how to do it your way either.
All I’m trying to do is make my scrolling text block have tabs and italics, I don’t care if it’s from an external text file or if it’s embedded.
Please help.
t2d
system
February 5, 2003, 1:13am
8
Where does this code go? Just anywhere in the same movie as the scrolling text bar?
yes. anywhere when you want to load the text
What do I name my text box variable?
give it a instance name not a variable. the instance name is myTextBox in that case
Is “textfile.txt” the external text file?
yes. change it to whatever you named your text file
or …
myTextFormat = new TextFormat ()
myTextFormat.italic = true
dynamicTextFieldInstanceName.setTextFormat (myTextFormat)
system
February 5, 2003, 1:44am
9
No luck whatsoever.
I’m so aggravated! I’m doing this in Flash 5 but it isn’t working in Flash MX either.
The .fla file is (do save target as): www.argoncreative.com/test/intro03-4.fla
The text file is (do save target as): www.argoncreative.com/test/FAQs.txt
edit: the problem is in the FAQs section.
t2d
system
February 5, 2003, 3:57am
10
wow dude !! your file was a real mess :stunned:
anyway … just copy and paste in your file and it should work
system
February 5, 2003, 2:27pm
11
This works in Flash MX but not in Flash 5.
I think because you can’t name an instance in Flash 5 unless it’s a symbol.
I tried making the text field a symbol and it didn’t work. I also tried copying and pasting the code to the level of the text field symbol and that didn’t work either.
Does anyone know how to get around this problem?
t2d
system
February 5, 2003, 9:26pm
12
just one question … why is this thread in the flash mx section then?
I’m doing this in Flash 5 but it isn’t working in Flash MX either
which means that you have them both … isn’t it?
just make the fla in mx !!