# Error 1120: Access of undefined property air

**URL:** <https://forum.kirupa.com/t/error-1120-access-of-undefined-property-air/296335>\
**Category:** flash\
**Created:** [September 13, 2009, 8:01pm UTC](https://forum.kirupa.com/t/error-1120-access-of-undefined-property-air/296335 "2009-09-13T20:01:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikel](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@nikel](https://forum.kirupa.com/u/nikel)\
**Post date:** [September 13, 2009, 8:01pm UTC](https://forum.kirupa.com/t/error-1120-access-of-undefined-property-air/296335/1 "2009-09-13T20:01:25Z")

</div>

I’m new with Air and I’ve found following code on the net:

```
 ActionScript Code:
 [LEFT][COLOR=#000000] **var** [/COLOR] file = air.[COLOR=#000080]File[/COLOR].[COLOR=#000080]applicationStorageDirectory[/COLOR].[COLOR=#000080]resolvePath[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"test.txt"[/COLOR][COLOR=#000000])[/COLOR]; 

```

[COLOR=#000000] **var** [/COLOR] str = [COLOR=#ff0000]“Hello.”[/COLOR];  
file.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]air.[COLOR=#000080]Event[/COLOR].[COLOR=#000080]COMPLETE[/COLOR], fileSaved[COLOR=#000000])[/COLOR];  
file.[COLOR=#000080]save[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000] **function** [/COLOR] fileSavedCOLOR=#000000[/COLOR]  
[COLOR=#000000]{[/COLOR]  
air.[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]

But I get following errors:

```auto

1120: Access of undefined property air. air.trace("Done."); 

1120: Access of undefined property air. var file = air.File.applicationStorageDirectory.resolvePath("test.txt"); 

1120: Access of undefined property air. file.addEventListener(air.Event.COMPLETE, fileSaved);

```

I’m using Flash CS4. I also tried publishing but it didn’t work. Can anyone help me?
