Script location

why is it when I put this code into the bat1 movie clip script area it doesnt work

onClipEvent (enterFrame) {
// controlling paddle 1 (Left Paddle)
if (Key.isDown(87)) {
if (bat1._y>=top._y+(bat1._height/2)) {
bat1._y += -10;
}
} else if (Key.isDown(83)) {
if (bat1._y<=bottom._y-(bat1._height/2)) {
bat1._y += 10;
}
}
}

but when I use this code on the main script page

	// controlling paddle 1 (Left Paddle)
if (Key.isDown(87)) {
	if (bat1._y&gt;=top._y+(bat1._height/2)) {
		bat1._y += -10;
	}
} else if (Key.isDown(83)) {
	if (bat1._y&lt;=bottom._y-(bat1._height/2)) {
		bat1._y += 10;
	}
}

it does work is there a way of putting the script that deals with that movie in that movie or does all scripts have to go into the main script function?