# Problem with attachSound and Nested Movie Clips

**URL:** <https://forum.kirupa.com/t/problem-with-attachsound-and-nested-movie-clips/232533>\
**Category:** flash\
**Created:** [July 15, 2007, 9:34am UTC](https://forum.kirupa.com/t/problem-with-attachsound-and-nested-movie-clips/232533 "2007-07-15T09:34:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueEyedMonster](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@BlueEyedMonster](https://forum.kirupa.com/u/BlueEyedMonster)\
**Post date:** [July 15, 2007, 9:34am UTC](https://forum.kirupa.com/t/problem-with-attachsound-and-nested-movie-clips/232533/1 "2007-07-15T09:34:49Z")

</div>

Hey all,

I’m building a video / audio player that plays provides audio along with a written transcript of the audio along the bottom of the player. I’m having a problem with getting attachSound to work.

Here is the set up:

I have audioplayer.swf which is the main player. It has the start / stop buttons and the majority of the code that interacts with the xml and dynamic content. It has a mc instance **clipholder** into which the dynamic content is loaded.

The dynamic content is numbers, 01.swf, 02.swf, 03.swf etc.

In 01.swf there is 5 paragraphs, each of which has it’s own text and audio component. The end of paragraph 1 triggers the playing of paragraph 2, and so on.

```auto

var audio:Sound = new Sound();
audio.attachSound("audio_1");
audio.start();
audio.onSoundComplete = function() {
    _parent.cliptwo.gotoAndPlay(2);
    _parent.clipone._visible = false;
};

```

Basically, I"m using onSoundComplete to trigger the next audio section so that the text matches up with the audio.

The attached audio is in the library of 01.swf. It won’t work when loaded into audioplayer.swf. If only works if I copy the attached audio into the library of the audioplayer.swf, which obviously isn’t going to work if it is to be dynamic.

Suggestions??
