# AS1 to AS2 conversion? Simple?

**URL:** <https://forum.kirupa.com/t/as1-to-as2-conversion-simple/230383>\
**Category:** flash\
**Created:** [June 25, 2007, 9:34pm UTC](https://forum.kirupa.com/t/as1-to-as2-conversion-simple/230383 "2007-06-25T21:34:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![waynebrady](https://avatars.discourse-cdn.com/v4/letter/w/eb8c5e/32.png) [@waynebrady](https://forum.kirupa.com/u/waynebrady)\
**Post date:** [June 25, 2007, 9:34pm UTC](https://forum.kirupa.com/t/as1-to-as2-conversion-simple/230383/1 "2007-06-25T21:34:01Z")

</div>

Hello all.

I’m trying to convert this PONG code so I can load this into an AS2 swf site. Anyone have any recommendations on where I could go to brush up on my AS1 🙂 it looks so foreign to me compared to AS2/3!

```auto

onClipEvent (load) {
    xpos = _root.bal._x;
    ypos = _root.bal._y;
}
onClipEvent (enterFrame) {
    setProperty(this, _x, this._x + /:xspeed);
    setProperty(this, _y, this._y + /:yspeed);
    if (this._x >= _root.right._x and this._y >= _root.right._y - 25 and this._y <= _root.right._y + 25) {
        _root.bal._x = _root.bal._x-(_root.bal._x-_root.right._x);
        /:xspeed = -/:xspeed - 0.2;
        /:hits1 = /:hits1 + 1;
    }
    if (this._x <= _root.left._x and this._y >= _root.left._y - 25 and this._y <= _root.left._y + 25) {
        _root.bal._x = _root.bal._x + (_root.left._x - _root.bal._x);
        /:hits2 = /:hits2 + 1;
        /:xspeed = -/:xspeed;
    }
    if (this._y < _root.top._y) {
        /:yspeed = -/:yspeed;
    }
    if (this._y >_root.bottom._y) {
        /:yspeed = -/:yspeed;
    }
    if (this._x >= _root.right._x + 12) {
        /:misses1 = /:misses1 + 1;
        /:xspeed = 0;
        /:yspeed = 0;
        setProperty("/bal", _x, xpos);
        setProperty("/bal", _y, ypos);
    }
    if (this._x <= _root.left._x - 12) {
        /:misses2 = /:misses2 + 1;
        /:xspeed = 0;
        /:yspeed = 0;
        setProperty("/bal", _x, xpos);
        setProperty("/bal", _y, ypos);
    }
}

```
