Scrollbar tutorial: html appears in external file


i’ve used your great “external file with scrollbar UI component” tutorial. text appears and scrolls. thanks alot!

but i want to use the allowed html in the external file: bold, a href, font, etc.

i’m horrified to see that even with the html option selected, when you attach the scrollbar UI to the textfield, the html reverts to code! no bold text but the html code displays! yikes!

any workarounds?



Have something to the effect of…

_root.yourTextBox.<B>html</B> = true;
_root.yourTextBox.<B>htmlText</B> = “<I>HELP</I>”

The htmlText part is required for flash to know that the text being showed should be converted.


this is the key! thanks muchly! the final code now reads:

//instantiating the load & naming the external file

loadText = new loadVars();

//creating the loadVarsText function

loadText.onLoad = function() {
box.htmlText = this.textbox;

final question: how can i keep my text from jamming right up against the textfield border on the left? there doesn’t seem to be any equivalent of padding or margin. . .do i just have to put spaces before the text on every line?

thanks again,


I am not testing this but is something along the lines of…

myformat = new TextFormat();
	myformat.leftMargin = 10;
	myformat.rightMargin = 10;

can you show me how it was done? i was confused



well, thanks for the pointer! my textfield’s instance name is "box; variable name “textbox.” after your hints i found in the actionscript manual the methods & attributes you were kind enough to offer.

so the alignment portion of the code is now:

//instantiate the format

myformat = new TextFormat();

//set margins for textfield

myformat.leftMargin = 10;
myformat.rightMargin = 25;

//apply format to textfield instance;

however, while this does work when the text content is a variable inside the flash movie, it doesn’t seem to work when you are loading an external html file. what dumb thing am i missing?

is there a different method or attribute for the html? should i just put this alignment in the external file, as i can with the html tags? the actionscript manual doesn’t offer an example of the correct usage of the alignment tags as supported html, although it does say they are supported. . .

any examples?

thanks again,


:frowning: is it possible to inclue pictures (gifs/jpgs) int the txt external file ?

Unfortunately no it isn’t:(

it all works now! here’s the best practice, i think:

//create the load

var loadText = new loadVars();

//create and define the function & formatting

loadText.onLoad = function() {
var myformat = new TextFormat();
myformat.leftMargin = 20;
myformat.rightMargin = 10; = this.textbox;;

//give the name of the external html file


thanks for all your help!