About Global Variables

In my movie I load a swf to a movieclip with this code

 _root.ImageViewer.loadMovie("deneme.swf");

Now can I do this?

before calling the swf named deneme. When I press a button If I attain a number to a global variable with this code

 
on (release) {
_global.myVar = 5;
gotoAndPlay("CloseUpAnimation");
}

Can I read this variable from the swf which I load into my movie?

If I can read how can I write a If Statement that will gotoAndPlay according to that variable?

 If (_global.myVar=5) { 
gotoAndPlay("Animation5");
}

Can it be done?