# TextField.maxscroll always returns 1?

**URL:** <https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647>\
**Category:** Uncategorized\
**Created:** [August 17, 2004, 4:04am UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647 "2004-08-17T04:04:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [August 17, 2004, 4:04am UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647/1 "2004-08-17T04:04:56Z")

</div>

I’m publishing in Flash Player 7 and using the older Flash MX scroll bar component. I just want it to disappear when not needed but

```auto
maxscroll

```

always returns

```auto
1

```

when using trace.

The AS that should work:

```auto
sbar._visible = (homeinfo.maxscroll > 1);

```

but these always return “1” reguardless of the amount of text:

```auto
trace("scroll" + homeinfo.scroll);
trace("maxscroll" + homeinfo.maxscroll);
trace("bottomScroll" + homeinfo.bottomScroll);

```

The textbox has an instance name “homeinfo” and it is a dynamic textbox which loads an html file just fine.

This seems like I’m missing something obvious or am not aware of some incompatibility. Thanks so much in advance!

---

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [August 17, 2004, 2:03pm UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647/2 "2004-08-17T14:03:29Z")

</div>

So let me ask it this way, if i am using the scrollbar component from a previous flash version, and i want to find out if the text box is full, how can i do that in MX / version 7? Thanks!

---

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [August 17, 2004, 2:52pm UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647/3 "2004-08-17T14:52:56Z")

</div>

So i figured it out. I moved the textbox to a few frames sooner than when

```auto
maxscroll

```

starts checking and then it worked. Even though i had the script below the text loading, it still didn’t have enough time to load. Basically i load the text into the box and then a few frames later i test the box to see if it needs the scroller. Hopefully that will help some other poor soul.

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [August 17, 2004, 2:55pm UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647/4 "2004-08-17T14:55:26Z")

</div>

Thanks for posting the solution instead of just saying “I figure it out, thanks anyway”. I guarantee this post will help someone at some time. :thumb:

---

<div class="post-metadata">

**Author:** ![claudio](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@claudio](https://forum.kirupa.com/u/claudio)\
**Post date:** [August 17, 2004, 3:02pm UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647/5 "2004-08-17T15:02:54Z")

</div>

If you’re loading some external text, use the _onLoad_ method of the _LoadVars_ object to check if the file has finished loading.

---

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [August 17, 2004, 3:07pm UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647/6 "2004-08-17T15:07:42Z")

</div>

> [@claudio](#):
>
> If you’re loading some external text, use the _onLoad_ method of the _LoadVars_ object to check if the file has finished loading.

Could you post an example of how this would work? That sounds like just the thing i need!

---

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [August 17, 2004, 3:30pm UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647/7 "2004-08-17T15:30:57Z")

</div>

> [@lunatic](#):
>
> Thanks for posting the solution instead of just saying “I figure it out, thanks anyway”. I guarantee this post will help someone at some time. :thumb:

I’m just glad i could finally contribute something! I’ve been reading these forums for awhile now and they really have helped me a great deal.

---

<div class="post-metadata">

**Author:** ![claudio](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@claudio](https://forum.kirupa.com/u/claudio)\
**Post date:** [August 17, 2004, 4:11pm UTC](https://forum.kirupa.com/t/textfield-maxscroll-always-returns-1/119647/8 "2004-08-17T16:11:30Z")

</div>

Yea of course:

```auto
my_data = new LoadVars();
my_data.onLoad = function(success){
if(success){
my_textfield.text = this.myVar;//assign the content of the textfile to the textfield
trace(my_textfield.maxscroll);//at this point you can make sure the file has been loaded
}
}
my_data.load("my_file.txt");

```
