# How to instantiate sound from shared library?

**URL:** <https://forum.kirupa.com/t/how-to-instantiate-sound-from-shared-library/321512>\
**Category:** Uncategorized\
**Created:** [April 21, 2011, 2:56pm UTC](https://forum.kirupa.com/t/how-to-instantiate-sound-from-shared-library/321512 "2011-04-21T14:56:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tugboat](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tugboat](https://forum.kirupa.com/u/tugboat)\
**Post date:** [April 21, 2011, 2:56pm UTC](https://forum.kirupa.com/t/how-to-instantiate-sound-from-shared-library/321512/1 "2011-04-21T14:56:34Z")

</div>

Helloooo.

I’m building a [shared library](http://www.kirupa.com/developer/flash8/shared_library.htm) of sounds, but am having trouble referencing them in code in the swf that needs them.

First I built the built the library and clicked ‘export for runtime sharing’.

Second I built another swf, went to file \> open external library, and dragged and dropped the sounds I need into the new library.

Third, I tried to reference it in as3 the way I would normally:

var mySound:mySoundClassName = mySoundClassName();  
mySound.play();

and I get two errors, a 1046 and an 1180.

So my question is: how does one instantiate a sound item from a shared library in AS3?

[RIGHT]\*okay, so I have a hack that works: I created a movieclip in the swf that contains the imported sound. I can reference this movieclip as needed and it’ll play the sound. But this seems sloppy and impractical considering how many sounds I need imported in this swf. So any help would be greatly appreciated. \*[/RIGHT]
