# What's wrong with this simple code? MX

**URL:** <https://forum.kirupa.com/t/whats-wrong-with-this-simple-code-mx/7132>\
**Category:** Uncategorized\
**Created:** [October 24, 2002, 12:24pm UTC](https://forum.kirupa.com/t/whats-wrong-with-this-simple-code-mx/7132 "2002-10-24T12:24:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pjc4real](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@Pjc4real](https://forum.kirupa.com/u/Pjc4real)\
**Post date:** [October 24, 2002, 12:24pm UTC](https://forum.kirupa.com/t/whats-wrong-with-this-simple-code-mx/7132/1 "2002-10-24T12:24:02Z")

</div>

In my main movie (using Flash MX), I am trying to load a welcome section (“welcome.swf”) into a blank movieclip (instance name: contents)

Now, welcome.swf has its own simple preloader (in a separate scene). When I test the movie (welcome.swf) on its own, its fine - the little preloading animation shows. However, when trying to load it from the main movie, all I get is a brief glimpse of the preloader animation then MY MAIN MOVIE RETURNS TO THE BEGINNING AGIN - AND KEEPS LOOPING!!

Here’s my code:

SCRIPT TO LOAD WELCOME SECTION:

\_root.contents.loadMovie(“welcome.swf”);

PRELOADER SCRIPT FOR WELCOME.SWF

total = \_root.getBytesTotal();  
loaded = \_root.getBytesLoaded();  
if (loaded\>=total) {  
\_root.gotoAndPlay(32)  
}

Why is it not working??? :-\
