# Need Help With this Code Please!

**URL:** https://forum.kirupa.com/t/need-help-with-this-code-please/239259
**Category:** flash
**Created:** [September 19, 2007, 11:37pm UTC](https://forum.kirupa.com/t/need-help-with-this-code-please/239259 "2007-09-19T23:37:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lckeys](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@lckeys](https://forum.kirupa.com/u/lckeys)
#### Post date: [September 19, 2007, 11:37pm UTC](https://forum.kirupa.com/t/need-help-with-this-code-please/239259/1 "2007-09-19T23:37:28Z")

</div>

[COLOR=#003366]Hi, i got this code made by Scotty, it’s an [COLOR=navy]example[/COLOR] on how to load external swfs sliding horizontally onto an mc container. Here’s the part of the code that i need to modify:[/COLOR]

```auto
 
MovieClip.prototype.slideTo = function(tar) {
    this.onEnterFrame = function() {
        this._x = tar-(tar-this._x)/1.3;
        if (Math.abs(this._x-tar)<1) {
            this._x = tar;
            delete this.onEnterFrame;
        }
    };
};

```

[COLOR=#003366]It works nice, but i’d also like to move some graphics vertically using the same code. So if there is a way of adding a “\_y” function or something like that to this code so that it’ll allow you to slide things horizontally and vertically at the same time. [/COLOR]

[COLOR=#003366]Any guide on how to do this will be much appreciated[/COLOR]
