# \[mx\] Code Question

**URL:** https://forum.kirupa.com/t/mx-code-question/48319
**Category:** flash
**Created:** [April 12, 2004, 3:23pm UTC](https://forum.kirupa.com/t/mx-code-question/48319 "2004-04-12T15:23:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![foochuck](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@foochuck](https://forum.kirupa.com/u/foochuck)
#### Post date: [April 12, 2004, 3:23pm UTC](https://forum.kirupa.com/t/mx-code-question/48319/1 "2004-04-12T15:23:39Z")

</div>

Does anyone see any problems with the code below:

[AS]

stop();

\_global.homeTimeline = this;

var loaded = false;

section\_mc.onEnterFrame = function() {  
if (!homeTimeline.loaded && (this.\_url != \_root.\_url)) {  
if (this.getBytesLoaded() == this.getBytesTotal() ) {  
homeTimeline.loaded = true;  
homeTimeline.trans\_mc.gotoAndPlay(“start”);  
}  
}  
}

[/AS]

Basically I’m trying to figure out a problem with the onEnterFrame function. It works the first time around in my movie but when I come back to it a 2nd time it doesn’t function correctly.

Any ideas?

Foo
