If statement, I guess?

Here is what I want to do.

I have a button with this action script.
on (release) {
label = “profile”;
_root.door.closedoor();
}

and at the end of the “door” movie clip, I have this action script.

label = _root.label;
_root.gotoAndStop(label);
//I guess I put if statement here.
this.gotoAndPlay(“open”);

So, after this, it goes to the label that is specified.
When it goes there, there is an action to load another movie.

loadMovie(“profile.swf”, “loadprofile”);

Here, I want to put a preloader.
I put the preloader in the movie that gets loaded, but it doesn’t look right.
So I want to put the preloader before the door opens up.
when the movie is loaded, I want the door to open up.
"if profile.swf is being loaded, stop. when the profile.swf is loaded, this.gotoAndPlay(“open)”;
if I describe, it is like this. (sorry, I don’t know anything about action script!!)

I attached a swf file.
I couldn’t attach a .fla movie because it was too big. If you think you can help me, I will be happy to send the file to you.

thanks!!

well, something like this i guess:

if (loadprofile.getBytesLoaded() < loadprofile.getBytesTotal()) {
  stop();
  this.onEnterFrame = waitForLoaded;
} else this.gotoAndPlay("open");

function waitForLoaded() {
  if (loadprofile.getBytesLoaded() == loadprofile.getBytesTotal()) this.gotoAndPlay("open");
}