Creating area where movie clip can moving but can not go away from this area
I want make somethin line first movie clip must moving in second movie clip, but can not go away from second movie clip.
stage.addEventListener(KeyboardEvent.KEY_DOWN, starMoving);
function starMoving(event:KeyboardEvent):void
{
switch (event.keyCode)
{
case Keyboard.UP : star_mc.y-=10;
break;
case Keyboard.DOWN : star_mc.y+=10;
break;
case Keyboard.LEFT : star_mc.x=star_mc.x-10;
break;
case Keyboard.RIGHT : star_mc.x+=10;
break;
default:
break;
}
}
So this is the code for manipulate first movie clip.. i can go everywhere on the stage...
How i can make then first movie clip moved just in second?
Thank you.