# If statement, I guess?

**URL:** <https://forum.kirupa.com/t/if-statement-i-guess/20543>\
**Category:** Uncategorized\
**Created:** [May 10, 2003, 1:42am UTC](https://forum.kirupa.com/t/if-statement-i-guess/20543 "2003-05-10T01:42:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![takashi0808](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@takashi0808](https://forum.kirupa.com/u/takashi0808)\
**Post date:** [May 10, 2003, 1:42am UTC](https://forum.kirupa.com/t/if-statement-i-guess/20543/1 "2003-05-10T01:42:57Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 10, 2003, 7:19pm UTC](https://forum.kirupa.com/t/if-statement-i-guess/20543/2 "2003-05-10T19:19:44Z")

</div>

well, something like this i guess:

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

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

```
