# Scrollbar Tutorial

**URL:** https://forum.kirupa.com/t/scrollbar-tutorial/22189
**Category:** random
**Created:** [May 31, 2003, 7:01pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189 "2003-05-31T19:01:20Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 31, 2003, 11:57pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/21 "2003-05-31T23:57:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:04am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/22 "2003-06-01T00:04:02Z")

</div>

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

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 4:55am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/23 "2003-06-01T04:55:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 10:53am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/24 "2003-06-01T10:53:07Z")

</div>

```auto
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…

```auto

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…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 11:09am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/25 "2003-06-01T11:09:15Z")

</div>

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]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 11:27am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/26 "2003-06-01T11:27:47Z")

</div>

Not working still…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 11:28am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/27 "2003-06-01T11:28:54Z")

</div>

…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 11:38am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/28 "2003-06-01T11:38:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 11:43am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/29 "2003-06-01T11:43:40Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 11:45am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/30 "2003-06-01T11:45:11Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 11:47am UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/31 "2003-06-01T11:47:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:06pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/32 "2003-06-01T12:06:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:16pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/33 "2003-06-01T12:16:45Z")

</div>

Maybe i am doing something wrong…

Can you send me the .txt file please?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:18pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/34 "2003-06-01T12:18:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:21pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/35 "2003-06-01T12:21:45Z")

</div>

Well, its not me. That doesnt work either.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:23pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/36 "2003-06-01T12:23:32Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:29pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/37 "2003-06-01T12:29:14Z")

</div>

Just a test site im doing…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:30pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/38 "2003-06-01T12:30:49Z")

</div>

Oops

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:38pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/39 "2003-06-01T12:38:02Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 1, 2003, 12:40pm UTC](https://forum.kirupa.com/t/scrollbar-tutorial/22189/40 "2003-06-01T12:40:16Z")

</div>

[news.fla download removed from server]

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

[Previous page](https://forum.kirupa.com/t/scrollbar-tutorial/22189.md?page=1)

[Next page](https://forum.kirupa.com/t/scrollbar-tutorial/22189.md?page=3)
