# Nested dynamic loading of swf files

**URL:** <https://forum.kirupa.com/t/nested-dynamic-loading-of-swf-files/213948>\
**Category:** flash\
**Created:** [January 24, 2007, 2:49pm UTC](https://forum.kirupa.com/t/nested-dynamic-loading-of-swf-files/213948 "2007-01-24T14:49:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lekha](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@lekha](https://forum.kirupa.com/u/lekha)\
**Post date:** [January 24, 2007, 2:49pm UTC](https://forum.kirupa.com/t/nested-dynamic-loading-of-swf-files/213948/1 "2007-01-24T14:49:29Z")

</div>

I am a beginner in flash. I have an important doubt to ask. Please help. Let me explain to u the matter.I have main course menu **(main.swf)**.From here the \*\*Intro.swf \*\*will be called.This \*\*intro.swf **calls another file** introsound.swf. \*\* This contains all the sounds used in the \*\*intro.swf. \*\*so I am loading the \*\*introsound.swf \*\*dynamically from \*\*intro.swf \*\*before playing the rest.

**Independently** the \*\*intro.swf \*\*works with the sound loaded in the beginning.

But when this **intro.swf** is called from the **main .swf,** the\*\* intro.swf \*\*stops at the first frame. This first frame is basically where i have the preloader of the **introsound.swf.**

Why does this happen when called from the \*\*main.swf.  
I noticed that the [COLOR=Blue]loop[/COLOR] movieclip’s clipevents are not even been entered.  
This are the clipevents in the empty movie clip called [COLOR=#0080ff]loop[/COLOR] in the file Intro.swf… There is another empty movieclip called [COLOR=#0080ff]SoundLoader.[/COLOR]

onClipEvent (load) {  
doOnce=0;  
\_root.soundHolder.loadMovie(“introsound.swf”);  
}

onClipEvent (enterFrame) {

```
soundsBytesTotal = _root.soundHolder.getBytesTotal();
soundsBytesLoaded = _root.soundHolder.getBytesLoaded();
percentLoaded = Math.round((soundsBytesLoaded/soundsBytesTotal)*100);

```

if (percentLoaded \> 99 && doOnce !=1) {  
doOnce = 1;  
\_root.gotoAndPlay(“2”);  
\*\*\*\* delete this.enterFrame;  
}  
}

\*\*\*\*[COLOR=#bf00bf]//In frame 2 of Intro.swf, I have the following code[/COLOR]  
[COLOR=#bf00bf]//[/COLOR]**[COLOR=#bf00bf]** mySoundPosition=\_root.firstSound.position;  
//\_root.firstSound.start(mySoundPosition,0);\*\*[/COLOR]  
\*\*// firstSound is defined in introsound.swf with the following code  
//\_root.firstSound=new Sound(this); \_root.firstSound.attachSound(“tr2”);  
//tr2 is the identifier for the mp3 sound file which i have set the necessary linkage //properties.

\*\*
