# Code Not Working

**URL:** <https://forum.kirupa.com/t/code-not-working/305483>\
**Category:** flash\
**Created:** [February 26, 2010, 1:57am UTC](https://forum.kirupa.com/t/code-not-working/305483 "2010-02-26T01:57:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danny0123](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@Danny0123](https://forum.kirupa.com/u/Danny0123)\
**Post date:** [February 26, 2010, 1:57am UTC](https://forum.kirupa.com/t/code-not-working/305483/1 "2010-02-26T01:57:35Z")

</div>

```auto
class People extends MovieClip {
    var speed:Number = 2;
    function onLoad(){
        this._x = -10;
        this._y = 350;
    }
    function onEnterFrame(){
        this._x += speed;
        checkRemove();
        this.swapDepths(_root.getNextHighestDepth());
        checkCollision();
    }
    
    function checkRemove(){
        if(this._x > Stage.width+10){
            this.removeMovieClip();
        }
    }
//here's the problem, import will not work.
    function checkCollision(){
        var xVal:Number = this._x;
        import Robot;
        if(this.hitTest(_root.RobotInstance) && Robot.GRAVITY > 0){
            this.removeMovieClip();
            _root.attachMovie("Bloody", "BloodMC"+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:xVal, _y:355});
        }
    }
}

```
