# Loading text from xml \[f8\]

**URL:** <https://forum.kirupa.com/t/loading-text-from-xml-f8/216195>\
**Category:** Uncategorized\
**Created:** [February 14, 2007, 12:01pm UTC](https://forum.kirupa.com/t/loading-text-from-xml-f8/216195 "2007-02-14T12:01:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunReedr](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@sunReedr](https://forum.kirupa.com/u/sunReedr)\
**Post date:** [February 14, 2007, 12:01pm UTC](https://forum.kirupa.com/t/loading-text-from-xml-f8/216195/1 "2007-02-14T12:01:24Z")

</div>

This is what I have …

I have a main\_mc inside the main\_mc is a dynamic text field with the instance name dummyText\_txt \> var is dummy its multiline and scrollable and render text as html is selected.

My external text file is called dummy.txt when I test it only part of the external text file shows.

Example is the blog section:  
[http://home.comcast.net/~s.oravec/site-ic.html](http://home.comcast.net/%7Es.oravec/site-ic.html)

Fla is here :  
[http://home.comcast.net/~s.oravec/site-ic.fla](http://home.comcast.net/%7Es.oravec/site-ic.fla)

I kinda think that somewhere in the script that makes the text scroll is my problem  
but, I`m not sure I’m new to flash and action script.

button/scrollbar :

```auto
var loadText:LoadVars = new LoadVars();
loadText.load("dummy.txt");

loadText.onLoad = function(success) {
    if (success) {
        main.dummyText_txt.htmlText = this.dummy;
    }
};
var blogStyle = new TextField.StyleSheet();
blogStyle.load("blogStyle.css");
main.dummyText_txt.styleSheet = blogStyle;

//buttons/scroll bar
fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor = false;
space = 20;
friction = 0.9;
speed = 4;
y = dragger._y;
top = main.dummyText_txt._y;
bottom = main.dummyText_txt._y + mask_mc._height -main.dummyText_txt._height - space;
dragger.onPress = function() {
    drag = true;
    this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y + this._parent.bar._height - this._height);
    dragger.scrollEase();
};
dragger.onMouseUp = function() {
    this.stopDrag();
    drag = false;
};
bar.onPress = function() {
    drag = true;
    if (this._parent._ymouse > this._y + this._height - this._parent.dragger._height) {
        this._parent.dragger._y = this._parent._ymouse;
        this._parent.dragger._y = this._y + this._height - this._parent.dragger._height;
    } else {
        this._parent.dragger._y = this._parent._ymouse;
    }
    dragger.scrollEase();
};
bar.onMouseUp = function() {
    drag = false;
};
moveDragger = function (d) {
    if ((dragger._y >= y + bar._height - dragger._height && d == 1) || (dragger._y <= y && d == -1)) {
        clearInterval(myInterval);
    } else {
        dragger._y += d;
        dragger.scrollEase();
        updateAfterEvent();
    }
};
up_btn.onPress = function() {
    myInterval = setInterval(moveDragger, 10, -1);
};
down_btn.onPress = function() {
    myInterval = setInterval(moveDragger, 10, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp = function () {
    clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
    this.onEnterFrame = function() {
        if (Math.abs(dy) == 0 && drag == false) {
            delete this.onEnterFrame;
        }
        r = (this._y - y) / (bar._height - this._height);
        dy = Math.round((((top - (top - bottom) * r) - main.dummyText_txt._y) / speed) * friction);
        main.dummyText_txt._y += dy;
    };
};

```

**Sorry for posting this in the flash 8 should be in flash action script .**
