# \[AIR\]Saving Files To SharedObject

**URL:** <https://forum.kirupa.com/t/air-saving-files-to-sharedobject/241083>\
**Category:** flash\
**Created:** [October 9, 2007, 9:30pm UTC](https://forum.kirupa.com/t/air-saving-files-to-sharedobject/241083 "2007-10-09T21:30:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gazurt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gazurt/32/4060_2.png) [@Gazurt](https://forum.kirupa.com/u/Gazurt)\
**Post date:** [October 9, 2007, 9:30pm UTC](https://forum.kirupa.com/t/air-saving-files-to-sharedobject/241083/1 "2007-10-09T21:30:46Z")

</div>

I am doing a mp3 player like a Winamp :sc:

I can get names and urls of droped files.Then I use Sound class to play them. There is no problem.

But when user close my player and open again, the files must be on the list… I thought to use Shared Objects.

This my droped file code:  
[AS]  
var file\_list:SharedObject = SharedObject.getLocal(“files”);  
d = e.clipboard.getData(ClipboardFormats.FILE\_LIST\_FORMAT) as Array;  
file\_list.data.sounds = d.toString();[/AS]

You see it is array.No problem here.Then my first codes:  
[AS]  
var file\_list:SharedObject = SharedObject.getLocal(“files”);  
if (file\_list.data.sounds!=null) {  
d=file\_list.data.sounds.split(“,”)  
trace(d);  
}[/AS]

In output:

```auto
[object File],[object File],[object File],[object File]

```

Yes you think there is no problem.But yes there is ☹ I can’t get the files names or urls.The error like this:

> TypeError: Error #1034: Type Coercion failed: cannot convert “[object File]” to flash.filesystem.File.  
> at deneme0\_fla::MainTimeline/baslik\_yarat()  
> at deneme0\_fla::MainTimeline/deneme0\_fla::frame1()  
> at runtime::ContentPlayer/loadInitialContent()  
> at runtime::ContentPlayer/playRawContent()  
> at runtime::ContentPlayer/playContent()  
> at runtime::AppRunner/run()  
> at global/runtime::ADLEntry()  
> First of all can we save our files? If yes how? Thanks… 🙂
