# Preloading external SWF alpha issue

**URL:** https://forum.kirupa.com/t/preloading-external-swf-alpha-issue/280543
**Category:** flash
**Created:** [January 28, 2009, 6:54pm UTC](https://forum.kirupa.com/t/preloading-external-swf-alpha-issue/280543 "2009-01-28T18:54:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kmp3d](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@kmp3d](https://forum.kirupa.com/u/kmp3d)
#### Post date: [January 28, 2009, 6:54pm UTC](https://forum.kirupa.com/t/preloading-external-swf-alpha-issue/280543/1 "2009-01-28T18:54:25Z")

</div>

Please take a look at my code, as far as I can tell it looks correct. The preloader mc is set to alpha = 0, and the swf mc container is set to alpha = 100 when the external swf is completely loaded. But the preloader mc remains invisible the entire time, if I comment out the line in red the preloader mc remains visible the entire time, it doesn’t turn invisible when the % loaded reaches 100.

Flash CS4, Player 7, AS 2.0

Any thoughts.

//working  
this.loading\_mc.stop();

//Making container invisible in the beginning  
this.mainMovieContainer\_mc.\_alpha = 0;  
this.loading\_mc.\_alpha = 100;  
this.mainMovieContainer\_mc.loadMovie(“mainMoviePt1.swf”);

this.onEnterFrame = function() {

var total = this.mainMovieContainer\_mc.getBytesTotal();  
var loaded = this.mainMovieContainer\_mc.getBytesLoaded();  
var percent = Math.round((loaded/total)\*100);  
this.loading\_mc.gotoAndStop(percent);  
//trace(percent);

if (percent \>= 100) {  
[COLOR=red]this.loading\_mc.\_alpha = 0;[/COLOR]  
this.mainMovieContainer\_mc.\_alpha = 100;  
}

if(this.mainMovieContainer\_mc.mainMoviePt1\_mc.\_currentframe == 48)  
{  
this.mainMovieContainer\_mc.mainMoviePt1\_mc.stop();  
}  
}
