# Strange problem loading/unloading a .swf (AS3)

**URL:** <https://forum.kirupa.com/t/strange-problem-loading-unloading-a-swf-as3/300487>\
**Category:** flash\
**Created:** [November 22, 2009, 10:39am UTC](https://forum.kirupa.com/t/strange-problem-loading-unloading-a-swf-as3/300487 "2009-11-22T10:39:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lonestarchitect](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@Lonestarchitect](https://forum.kirupa.com/u/Lonestarchitect)\
**Post date:** [November 22, 2009, 10:39am UTC](https://forum.kirupa.com/t/strange-problem-loading-unloading-a-swf-as3/300487/1 "2009-11-22T10:39:29Z")

</div>

I noticed that I referenced the Kirupa forums often for finding solutions to flash-related problems. When I hit this last issue, this seemed to be the place with the best knowledge base.

Here is my issue: I have a flash site (portfolio), and it uses buttons to load/remove different .swf file (it is an XML gallery that I did not write.) It works perfectly - the FIRST time I load/unload a .swf . . . however, every .swf file loaded after the first one comes in partially transparent (it normally fades in), but otherwise the .swf is fully functional. Each .swf has it’s own unique name/images, but is otherwise identical to the original gallery. It doesn’t matter which one I open first - the first one is always correct, the rest, not. Also, the degree of transparency varies randomly, but generally seems to hover somewhere around 1/2 way.

This is the code I’m using to load the .swf:

var Photo6Gallery:Loader = new Loader();  
Photo6Gallery.load(new URLRequest(“Photo6.swf”));  
addChild(Photo6Gallery);

and this is what I use to unload:

removeChild(Photo6Gallery);  
Photo6Gallery.unloadAndStop();  
Photo6Gallery = null;

I will plainly state - I am a designer, not a programmer, and my knowledge of AS3 is limited. I know that something in the XML gallery is causing this (switch to a completely different .swf and the transparency issues go away), but I also think that I am likely not unloading the .swf correctly and that some part of it is remaining in the memory and creating issues when it is used more than once. Any thoughts/suggestions?
