Might be a logic problem?

Hello,

I have a weird sort of a problem, i’ve pretty much got an inventory MC inside another MC for the map which is sitting on the main stage. So that the inventory will stay still with the character (the map moves when you use the arrow keys not the char) instead of moving with the map, i have the inventory running a function. The function is:

function moveinv (inv) {
    if(Key.isDown(Key.RIGHT)) {
        inv._x += _global.right_speed;
    } else if(Key.isDown(Key.LEFT)) {
        inv._x -= _global.left_speed;
    } else if (Key.isDown(Key.DOWN)) {
        inv._y += _global.down_speed;
    } else if (Key.isDown(Key.UP)) {
        inv._y -= _global.up_speed;
    }
}

the _global.direction_speed is the same variable used for the maps movement. If you hit one of the blockers which is just an MC then it will run a function (in this case if you hit a blocker from the left side):

function rightblock (block) {
        bk = eval(block);
        if (_root.map2.character.hitTest(bk)==true) {
        _global.right_speed -= _global.right_speed;
    }
}

This stops the movement of the character which works perfectly, and it should stop the movement of the inventory cause its the same variable, however the inventory MC will jump roughly 5 pixels to for example the right if you were heading right etc. Which is the same amount as the variable for the movement speed. I can’t really see what would be causing it to do this except for maybe if theres a logic problem? Heres a link for the swf incase you didn’t understand my description. http://tonic.matric.com.au/RPG_main8mx.swf any help would be great =D

Thanks,
Grant.