# Creating sliding text field in movie clip

**URL:** <https://forum.kirupa.com/t/creating-sliding-text-field-in-movie-clip/217864>\
**Category:** Uncategorized\
**Created:** [March 2, 2007, 3:40pm UTC](https://forum.kirupa.com/t/creating-sliding-text-field-in-movie-clip/217864 "2007-03-02T15:40:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mesilane](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mesilane](https://forum.kirupa.com/u/Mesilane)\
**Post date:** [March 2, 2007, 3:40pm UTC](https://forum.kirupa.com/t/creating-sliding-text-field-in-movie-clip/217864/1 "2007-03-02T15:40:39Z")

</div>

Is it possible at all? I have tried to put it to movie clip and it doesn’t work so I’d like to. It’s fine until I add borders where scroll is active. When I move cursor up and down, to move up or down, then it won’t work properly… Like lag or something.

This is the code I am using:

```auto

panel.onRollOver = panelOver;

function panelOver() {
    this.onEnterFrame = scrollPanel;
    delete this.onRollOver;
}

var b = stroke.getBounds(_root);

function scrollPanel() {
    if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
        this.onRollOver = panelOver;
        delete this.onEnterFrame;
    }
    
    if(panel._x >= 89) {
        panel._x = 89;
    }
    
    if(panel._x <= -751) {
        panel._x = -751;
    }
    
    var xdist = _xmouse - 250;
    
    panel._x += Math.round(-xdist / 7);
}

```

turtorial at [www.gotoandlearn.com](http://www.gotoandlearn.com)

Mesilane.
