# Please help me convert this from as1 to as2!

**URL:** https://forum.kirupa.com/t/please-help-me-convert-this-from-as1-to-as2/235927
**Category:** Uncategorized
**Created:** [August 15, 2007, 8:24pm UTC](https://forum.kirupa.com/t/please-help-me-convert-this-from-as1-to-as2/235927 "2007-08-15T20:24:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jpixels](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@jpixels](https://forum.kirupa.com/u/jpixels)
#### Post date: [August 15, 2007, 8:24pm UTC](https://forum.kirupa.com/t/please-help-me-convert-this-from-as1-to-as2/235927/1 "2007-08-15T20:24:15Z")

</div>

Hi, I’m trying to convert a very simple platform game from as1 to as2. When I change publish settings from flash 6/as1 to flash8/as2 the character falls through the level blocks which normally stop it from falling (in as1), here is the code in hero (the main guy - a movie clip):

onClipEvent(load){  
//initialize variables  
jump=false;  
scream=false;  
s=6;

```
this.gotoAndStop(1);

b = this.getBounds(this);

_root.timerID = setInterval(_root.goTime,10);

function move(x,y){
    h=false;
    
    if(!_root.map.hitTest(_x+x+b.xmin,_y+y+b.ymin,true)){
        if(!_root.map.hitTest(_x+x+b.xmax,_y+y+b.ymin,true)){
            if(!_root.map.hitTest(_x+x+b.xmin,_y+y+b.ymax,true)){
                if(!_root.map.hitTest(_x+x+b.xmax,_y+y+b.ymax,true)){
                    _root.map._x -= x;
                    _root.map._y -= y; 
                    h=true;
                    } 
                }
            }
        }  
 return h;
}

```

}

onClipEvent(enterFrame){  
falling = move(0,s);

```
  if(Key.isDown(Key.SPACE) && !falling && !jump){
        jump = true; vel = -10;
        _root.jumpSound.gotoAndPlay(2);}
 if(Key.isDown(Key.LEFT)){
     move(-s,0); this.play();
     }
 if(Key.isDown(Key.RIGHT)){
     move(s,0); this.play();
     }
        
if (jump) {
    if(vel &lt;= 10){
        h = move(0,vel-s);
        if(h == false && vel &lt; 0){ vel *= -1;}
        vel++;
    }
    else{
        jump = false;
    }
}
if (_root.map._y&lt;-450 && !scream) {
    scream=true; _root.fallSound.gotoAndPlay(2);
    }
if (_root.map._y&lt;-850) {
    _root.map._x=0;_root.map._y=0;scream=false;
    }

```

}

onClipEvent (keyUp) {  
this.gotoAndStop(1);  
}

that is pretty much all the code in the game, the rest is gotoAndStop etc

Can u spot anything there that would cause any probs in as2? My guess is something to do with getbounds or hittest…
