Question about Moving an MC

How can i limit the movment of an mc to a specific Root?

i mean… like a road or some thing like that…
me mc is moving simply by pressing the arrows…
for instance…

on("<Right>"){
this._y += 5;
}
and i do that for all the arrows :slight_smile:

thanks in advance :slight_smile: