# Scrollbar with imported txt file

**URL:** <https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758>\
**Category:** flash\
**Created:** [January 21, 2003, 10:38pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758 "2003-01-21T22:38:05Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![beuvema](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@beuvema](https://forum.kirupa.com/u/beuvema)\
**Post date:** [January 21, 2003, 10:38pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/1 "2003-01-21T22:38:05Z")

</div>

I want to create a scrollbar to view an imported txt file, want to use 2 buttons for up and down but don’t know where to start.  
Can anyone help…

---

<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:** [January 21, 2003, 10:44pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/2 "2003-01-21T22:44:32Z")

</div>

Just up and down buttons eh?

Well in that case you can start here…

[http://www.kirupa.com/developer/flash5/scrolltext.asp](http://www.kirupa.com/developer/flash5/scrolltext.asp)

---

<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:** [January 21, 2003, 11:02pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/3 "2003-01-21T23:02:35Z")

</div>

Thx for the quick response, indeed i can scroll text but not imported text do you have the next step??

---

<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:** [January 21, 2003, 11:32pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/4 "2003-01-21T23:32:14Z")

</div>

That one is covered here…

[http://www.kirupa.com/developer/mx/dynamic\_scroller.asp](http://www.kirupa.com/developer/mx/dynamic_scroller.asp)

Just skip the step of the scrollbar component.

---

<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:** [January 22, 2003, 12:33pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/5 "2003-01-22T12:33:30Z")

</div>

Still having problems…  
It works fine as a separate movie, but when I want to use in another movie, the text field remains empty.  
What could be wrong??

---

<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:** [January 22, 2003, 2:02pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/6 "2003-01-22T14:02:52Z")

</div>

In your movie with your scrollable text area change any \_root locators tobe \_parent. If instance names (or var names) don’t have a locator, add \_parent.

For example if the code is something like

myTextBox.scroll()

It would become

\_parent.myTextBox.scroll()

I didn’t get to look over the tutorials to give you more accurate code, but I am in a rush, so I don’t have time to, I just know a lot of times loaded movies don’t work when things are \_root because the \_root of the loaded movie becomes the \_root of the movie it is loading into, so in that case the location through AS is different and you need to use \_parent.

---

<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:** [January 22, 2003, 9:29pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/7 "2003-01-22T21:29:36Z")

</div>

You completely lost me…  
The stripped source file is too big to attach to this message 370k.  
Can I mail it to you?

Greetings Beuvema

---

<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:** [January 23, 2003, 3:48am UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/8 "2003-01-23T03:48:57Z")

</div>

Can you upload it to a server and link to it?

---

<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:** [January 23, 2003, 9:02am UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/9 "2003-01-23T09:02:33Z")

</div>

yes, I put it on

greetings Beuvema

---

<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:** [January 24, 2003, 6:40am UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/10 "2003-01-24T06:40:52Z")

</div>

Now that I got to see your actual setUp and everything it was easier to diagnose. My first diagnosis was wrong, you did not need ANY \_parents or anything. So I removed those, then I had to fix your loadVars script. You had something like scrollabletext.scroll = this.contacttext or something like that, but it really should have been scrollabletext.text not .scroll, after I changed this I also set your textboxes Instance name and Var name to “scrollabletext” (no quotes). Also… You kept in the AS text too. You had scrollabletext = “blah blah blah”, I think that was counteracting your loadVars possible, so I removed that as well.

Everything worked great after that.

I can’t upload as an attachment because it is too big, and my FTP is acting all floopy like… of course, my server has been down for days, and when it comes back up and I can use it, my FTP program wants to be a pain…lol.

I will post the code to change…

Your loadVars code should look like this…

```php
loadText = new loadVars();
loadText.load("contact.txt");
loadText.onLoad = function() {
	scrollableText = this.contacttext;
};
stop();

```

Your up button code should look like this…

```php
on (press, release, keyPress "<Up>") {
	currentScroll = scrollableText.scroll;
	if (Number(currentScroll)>1) {
		scrollableText.scroll = currentScroll-1;
	}
}

```

Your down button code should look like this…

```php
on (press, release, keyPress "<Down>") {
	currentScroll = scrollableText.scroll;
	if (Number(currentScroll)<Number(scrollableText.maxscroll)) {
		scrollableText.scroll = Number(currentScroll)+1;
	}
}

```

---

<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:** [January 24, 2003, 9:46pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/11 "2003-01-24T21:46:49Z")

</div>

LOSTINBETA THANX, THANX, THANX,

My problem is solved.

Greetings and have a nice weekend Beuvema

---

<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:** [January 24, 2003, 9:51pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/12 "2003-01-24T21:51:30Z")

</div>

No problem. Glad you got everything working.

---

<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:** [January 24, 2003, 10:49pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/13 "2003-01-24T22:49:20Z")

</div>

I have another question concerning the scroll bar.

If the text runs out the screen I want to start a movie within the main scene. The code I used does not start the movie.

if  
(Number  
(currentScroll)  
\< Number  
(\_root.scroller.scrollableText.maxscroll)  
)  
{  
lees\_verder.play(1)  
}

actually nothing is triggerd at all

Can you help me again???

---

<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:** [January 24, 2003, 10:56pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/14 "2003-01-24T22:56:12Z")

</div>

Untested, but you can try this…

```php
on (release, keyPress "<Down>") {
	currentScroll = scrollableText.scroll;
	if (Number(currentScroll)<Number(scrollableText.maxscroll)) {
		scrollableText.scroll = Number(currentScroll)+1;
	} else {
		trace("scroll down complete");
	}
}

```

I removed the press command so now it is just release and keyPress… I didn’t see a need for both press and release.

Note: Put this on your down button, then test your movie. Keep clicking the down button. When it reaches the end it SHOULD display “scroll down complete” in the output window.

---

<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:** [January 24, 2003, 11:17pm UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/15 "2003-01-24T23:17:40Z")

</div>

I think I formulated the question in the wrong way;

What I meant was that if the text is bigger than the text screen  
a button [more…] becomes visible

sorry for the inconvenience

---

<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:** [January 25, 2003, 2:14am UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/16 "2003-01-25T02:14:04Z")

</div>

Oh… I don’t know how to do that. At least not off the top of my head :-\ I might have to work at it for a bit, but I don’t have much time to.

---

<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:** [January 25, 2003, 10:35am UTC](https://forum.kirupa.com/t/scrollbar-with-imported-txt-file/11758/17 "2003-01-25T10:35:58Z")

</div>

Thx anyway, c u on this forum…
