# Why does this code not work?

**URL:** <https://forum.kirupa.com/t/why-does-this-code-not-work/83578>\
**Category:** flash\
**Created:** [March 20, 2005, 8:12am UTC](https://forum.kirupa.com/t/why-does-this-code-not-work/83578 "2005-03-20T08:12:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpearson311](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jpearson311](https://forum.kirupa.com/u/jpearson311)\
**Post date:** [March 20, 2005, 8:12am UTC](https://forum.kirupa.com/t/why-does-this-code-not-work/83578/1 "2005-03-20T08:12:55Z")

</div>

Ok, so I have one fla that has two scenes. One named intro and one named home, which has a frame label on the first frame named “home”. Obviously I want the intro to play first so I checked to make sure that intro is listed as being first in the scene panel, which it is, but I have yet to fix this problem.

In the intro scene, I have three layers. One is for script, one is a preloaders outerbar (which is a movieclip and has an instance name of outerBar\_mc), and the other layer is my progress bar which has an instance name of amount\_mc.

What I want to do is preload the entire swf where once it is all loaded it will gotoAndPlay the home scene. On the script layer of the intro scene, I have this script on frame 1.

stop();  
this.onEnterFrame = function(){  
var loaded = this.bytesLoaded  
var total = this.bytesTotal

if (loaded \>= total){  
this.gotoAndPlay(“home”);  
}else{  
this.gotoAndPlay(1);  
}

this.amount\_mc.\_yscale = loaded;  
}

On the home scene, all I have are ten frames with a movie clip tween from 0% alpha to 100%. I then have a labels layer where frame one is labeled home. I then have a script layer which has a stop action on frame 10.

The movie clip that tweens in has a loadVariables script on the inside of it loading an external text file, but that’s all that happens. I don’t see the movie clip fade in. It’s working just fine until I Ctrl + Enter it. Can anyone help me here? Thanks a lot,

Jesse
