# Load sound using getDefinitionByName

**URL:** <https://forum.kirupa.com/t/load-sound-using-getdefinitionbyname/242606>\
**Category:** Uncategorized\
**Created:** [October 28, 2007, 2:31pm UTC](https://forum.kirupa.com/t/load-sound-using-getdefinitionbyname/242606 "2007-10-28T14:31:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmjw1985](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@jmjw1985](https://forum.kirupa.com/u/jmjw1985)\
**Post date:** [October 28, 2007, 2:31pm UTC](https://forum.kirupa.com/t/load-sound-using-getdefinitionbyname/242606/1 "2007-10-28T14:31:33Z")

</div>

Hi I read in the archives about someone trying to find an alternative to attachSound(); in as3. But attachSound has been removed. The answer was to use:

```auto
 
import flash.utils.getDefinitionByName;
 
var theSound : Class = getDefinitionByName ( "sounds_library_name") as Class;
var instance : Object = new theSound ();

```

if this is the case, is this still classed as if it were a sound in this sense:

```auto

theSound:Sound = new Sound();

```

hope that made sense.

Thanks.
