Scrollbar Tutorial

The only reason it wouldn’t work is if you aren’t html enabling the text via actionscript.

textBoxInstance.html = true
textBoxInstance.htmlText = this.variableName

Also make sure you are setting the instance name of the textbox int the instance name box of the properties panel and NOT the var name box.

loadText = new loadVars();
loadText.load("news.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
		scroller.text = this.newstext;
};

Yeah, thats not HTML enabled, which is why it isn’t working. Check my last post and/or the post I did earlier with the 3 links on html enabling text.

loadText = new loadVars();
loadText.load("news.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
		scroller.text = this.newstext;
};
textBoxInstance.html = true
textBoxInstance.htmlText = this.Content


Tried that… And…


loadText = new loadVars();
loadText.load("news.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
		scroller.text = this.newstext;
};
textBoxInstance.html = true
textBoxInstance.htmlText = this.variable

Im abit stupid when it comes to action scripting…

I’ve tested it out a bit and now I will spell it out for you. This is the code that lostinbeta provided:

[AS]textBoxInstance.html = true
textBoxInstance.htmlText = this.Content[/AS]

Now “textBoxInstance” is the instance name of your text box believe it or not. And instead of:

[AS]scroller.text = this.newstext;[/AS]

You should use:

[AS]scroller.htmlText = this.newstext;[/AS]

Thus, if you were to correct the code you provided so that your textbox was html enabled and read the .txt file as if it were htmlText (so that you can use the limited number of html tags that work), it would look like this:

[AS]
loadText = new loadVars();
loadText.load(“news.txt”);

//creating the loadVarsText function
loadText.onLoad = function() {
scroller.html = true;
scroller.htmlText = this.newstext;
};
[/AS]

Enjoy :),
JK.

[bear in mind that I assumed your textbox’s instance name was scroller because that is what your previous code used]

Not working still…

Also, this part of the text file:

“newstext=
<b>01/06/03</b>”

Should be:

“newstext=<b>01/06/03</b>”

If you don’t want a large gap before the text in your textbox. Don’t jump between using the html code (like <br>) and using Enter to adjust the way the text appears until you have it all working. Stick to one.

Also, check the line spacing of the textbox via the “Format…” button of the properties panel when the textbox is selected. Try setting it to 2 for now.

Hope this helps,
JK.

Hmm… didn’t realise that html would be enabled in my posts. I had used the line break html code and it came up just with the line break - without the actual code, which is what I was trying to use to explain. And I can’t seem to get around that…

That works alot better now, but the text is still not properly aligned to the left side of the text box.

Hmm…

Remove the align html code you used in the text file. Instead, edit the properties of the textbox so that it is set to align the text to the left. See if that solves the problem :).

JK.

Ok. I have it all aligning fine now. My textbox was originally set to align text to the left and I haven’t touched that. I have just stuck the text from the text file you provided into a document and edited it accordingly.

If you enter your text as follows:
[AS]
newstext=<b>01/06/03</b>
<p align=“left”>
Site is almost done…(linebreak)Yep…(linebreak)About right
[/AS]

Note that this isn’t ActionScript but I can’t stop the html tags acting as html tags in my posts without using this. Therefore, make sure to replace (linebreak) with the html code for a linebreak.

Then this is what it should look like when you run the .swf:

[AS]01/06/03

Site is almost done…
Yep…
About right
[/AS]

The text is all aligned left and is working fine. If you follow this example, I think you should be able to solve your final problem - if you haven’t already.

Good luck,
JK.

Maybe i am doing something wrong…

Can you send me the .txt file please?

Sure. But make sure to edit what I have used (like “jktext=” should be something different for yours. “newstext=” I think).

Well, its not me. That doesnt work either.

Ok, attach the EXACT .txt document you are trying to use. With all the align code etc. and I will see what I can do…

Right now, I don’t know what isn’t working in yours because I’m not using yours.

Just a test site im doing…

Oops

Well… I have renamed and adjusted my .fla so that it will read your news.txt file instead of my one and I haven’t change anything else in the .fla

I have also edited your news.txt so that I have aligned left, right and center using the html code and have used bold and underline. I think the problem has to be in your .fla which means you may have made a mistake when following the tutorial…

The .fla is too large to attach so I will put it up on my own hosting and provide a download link in a second. I will only leave it up for a few minutes so be quick :).

I have attached news.txt here.

[news.fla download removed from server]

Hopefully this will resolve any remaining problems :),
JK.