# Exporting sounds from a .FLA

**URL:** https://forum.kirupa.com/t/exporting-sounds-from-a-fla/288948
**Category:** flash
**Created:** [May 23, 2009, 7:23pm UTC](https://forum.kirupa.com/t/exporting-sounds-from-a-fla/288948 "2009-05-23T19:23:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cmann](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@cmann](https://forum.kirupa.com/u/cmann)
#### Post date: [May 23, 2009, 7:23pm UTC](https://forum.kirupa.com/t/exporting-sounds-from-a-fla/288948/1 "2009-05-23T19:23:28Z")

</div>

Here’s a script to export all the sounds from your library.  
It should save them in the same directory as the FLA file.

```auto
var out=fl.outputPanel;
out.clear();
var doc=fl.getDocumentDOM();
var lib=doc.library;

var saveDir=doc.pathURI.substring(0, doc.pathURI.lastIndexOf("/")+1);

var itemCount=lib.items.length;
for(a=0; a<itemCount; a++){
    var item=lib.items[a];
    if(item.itemType!="sound")
        continue;
    
    item.exportToFile(saveDir+( item.name.substring(0, item.name.lastIndexOf(".")) )+".wav");
}

```

Save the code to a file called “Export Sounds.jsfl” in  
C:\Documents and Settings\username\Local Settings\Application Data\Adobe\Flash CS4\en\Configuration\Commands

This is something a put together in 5 minutes using the flash documentation.  
I have absolutely no experience with the flash javascript API so I cannot guarantee anything.  
It might work in previous versions of flash but I can’t really say for sure.
