Formatting scrollable text

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

anyone, please?

t2d

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:)

try this;

http://www.kirupaforum.com/showthread.php?s=&threadid=13587&highlight=html+dynamic

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

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

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. :frowning:

t2d

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)

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

:frowning:

edit: the problem is in the FAQs section.

t2d

wow dude !! your file was a real mess :stunned:

anyway … just copy and paste in your file and it should work

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

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 !!