# Starting Sounds loaded from an external swf

**URL:** <https://forum.kirupa.com/t/starting-sounds-loaded-from-an-external-swf/116942>\
**Category:** Uncategorized\
**Created:** [July 22, 2004, 5:58pm UTC](https://forum.kirupa.com/t/starting-sounds-loaded-from-an-external-swf/116942 "2004-07-22T17:58:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrda](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jrda](https://forum.kirupa.com/u/jrda)\
**Post date:** [July 22, 2004, 5:58pm UTC](https://forum.kirupa.com/t/starting-sounds-loaded-from-an-external-swf/116942/1 "2004-07-22T17:58:20Z")

</div>

I have one instance of a movieClip on the stage (from now on called this). It listens to its own movieClipLoader which loads an external swf file into this.audioLibrary

this.audioLibrary then contains a movieclip called liveAudio which contains three tracks, each with an attacked sound called audio.

I can run something like this successfully:

this.onLoadInit = function(audioLibrary)  
{  
trace(this.audioLibrary.liveAudio.track1.strName);  
}

but I can’t run this:

this.onLoadInit = function(audioLibrary)  
{  
this.audioLibrary.liveAudio.track1.audio.start();  
}

How can I gain control of the audio tracks? All objects are set to export for actionscript, my publish settings are right. The audio tracks start if I code a this.audio.start(); locally.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 22, 2004, 9:25pm UTC](https://forum.kirupa.com/t/starting-sounds-loaded-from-an-external-swf/116942/2 "2004-07-22T21:25:47Z")

</div>

[left]So i fiddle, following the advice in the comment under the livedocs entry for attachSound. My external swf now has one instance of an object of the following class:[/left]  
[left] [/left]  
[left] function LiveAudio()  
{  
this.onLoad = function()  
{  
this.trackLinks = ["",  
“engineers”,  
“melissaMigule”,  
“sharifa”  
];  
this.initAudio = function(audioPlayer, i)  
{  
this.attachMovie(“objTrack” + i, “track” + i, 160);  
this.audio = new Sound();  
this.audio.attachSound(this.trackLinks\*);  
this.audio.setVolume(100);  
audioPlayer.trackData = this[“track” + i];  
audioPlayer.audio = this.audio;[/left]  
[left] // audioPlayer.audio.start(); doesn’t work  
}  
}  
}  
[/left]  
[left]It has the objTrack[1¦2¦3]'s in the library and the relevant sounds [“engineers”, etc.] as well. The following function calls initAudio:[/left]  
[left] [/left]  
[left]this.onLoadInit = function(audioLibrary)  
{  
this.loadingSplash.removeMovieClip();  
this.createEmptyMovieClip(“audioPlayer”, 150);  
this.audioLibrary.liveAudio.initAudio(this.audioPlayer, 1);  
// this.audioPlayer.audio.start(); doesn’t work  
}[/left]  
[left] [/left]  
[left]The function is called and when I check variables I get a Sound in the right place:[/left]  
[left] [/left]  
[left]Movie Clip: Target="\_level0.virtualOffice.audioPlayer"  
Variable \_level0.virtualOffice.audioPlayer.trackData = [movieclip:\_level0.virtualOffice.audioLibrary.liveAudio.track1]  
Variable \_level0.virtualOffice.audioPlayer.audio = [object #255, class ‘Sound’][/left]  
[left] [/left]  
[left]But I can’t for the life of me turn the sound on. Can you help?[/left]
