# AS Not Working When Loaded into Container

**URL:** <https://forum.kirupa.com/t/as-not-working-when-loaded-into-container/249065>\
**Category:** Uncategorized\
**Created:** [January 14, 2008, 11:36pm UTC](https://forum.kirupa.com/t/as-not-working-when-loaded-into-container/249065 "2008-01-14T23:36:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RndmIND](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@RndmIND](https://forum.kirupa.com/u/RndmIND)\
**Post date:** [January 14, 2008, 11:36pm UTC](https://forum.kirupa.com/t/as-not-working-when-loaded-into-container/249065/1 "2008-01-14T23:36:20Z")

</div>

This code fades in a sound when the movie starts, and fades out when it reaches a specific frame. On its own, it works perfectly. The issue is when I try to view the page with the main holder SWF, which loads the separate SWF sections in with a container. I can’t see why it wouldn’t work when loaded. There are 3 other sounds on the page that work perfectly even when viewed from the container.

My entire site is done except this sound issue, so any help would be greatly apprecaited.

> 

cityLoop = new Sound(cityLoopMc);  
cityLoop.attachSound(“city”);  
cityLoopVolume=0;  
cityLoop.setVolume(cityLoopVolume);

fadeIn01=1  
cityLoop.start(0,999);

onEnterFrame = function () {

//Fade In  
if (fadeIn01==1) {  
cityLoop.setVolume(cityLoopVolume);  
cityLoopVolume=cityLoopVolume+1;  
if (cityLoopVolume\>99) {  
fadeIn01=0;  
}  
}

// Fade Out

if (fadeOut01==1) {  
cityLoop.setVolume(cityLoopVolume);  
cityLoopVolume=cityLoopVolume-3;  
if (cityLoopVolume\<5) {  
cityLoop.stop(“city”);  
fadeOut01=0;  
}  
}  
}
