# Qwick Qwestion regarding loading text externally and buttons!

**URL:** <https://forum.kirupa.com/t/qwick-qwestion-regarding-loading-text-externally-and-buttons/222264>\
**Category:** flash\
**Created:** [April 12, 2007, 2:18am UTC](https://forum.kirupa.com/t/qwick-qwestion-regarding-loading-text-externally-and-buttons/222264 "2007-04-12T02:18:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vexir](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vexir](https://forum.kirupa.com/u/Vexir)\
**Post date:** [April 12, 2007, 2:18am UTC](https://forum.kirupa.com/t/qwick-qwestion-regarding-loading-text-externally-and-buttons/222264/1 "2007-04-12T02:18:25Z")

</div>

So if I have the code

```auto
var currNewsPage:Number = 1;
loadText = new LoadVars();
    loadText.load("TEXT1.txt");
    loadText.onLoad = function(success) {
        if (success) {
            // trace(success);
            newsBox.html = true;
            newsBox.htmlText = this.myNews;
        }
    }

```

on a frame and I have a next button and a previous button. So, can I just have different text files like TEXT1 and TEXT2 and TEXT3 on the server, then just add the code “loadText.load(“TEXT” + (currNewsPage +or- 1) + “.txt”);” on the buttons? Will it work like that? (and of course, increment or decrement currNewsPage)

edit:// also if i made it like that and it worked like that how would i get Flash to find the number of pages total, so I could make sure the next button doesnt overincrement and load a nonexistent page?
