To acces a variable that is inside another MC, you can put "_root." + the instance name of the MC, followed by the variable name. If you want to access the variable "variable1" from the MC "enemy", just use something like this:
if(_root.enemy.variable1 != 0){
_root.enemy.variable1 = 0;
}
If the variable is in a movieclip that's inside another MC, stack it. The most upper one first. MC "lawl" is inside MC "hello". On MC "lawl", there's the variable "haha".
So:
_root.hello.lawl.haha = 1002;
If you adress a distant variable often in your script, you can assign it to another variable:
onEnterFrame = function () {
var movieclip = _root.lawl.variable1;
trace(movieclip);
// I've already defined variable1.
};
But keep in mind that it's a lot better to keep your code together. Either on one MC or on the main timeline. In AS3, you can't even code on MC's.