# ReferenceError: Error #1074: Illegal write to read-only property Array

**URL:** https://forum.kirupa.com/t/referenceerror-error-1074-illegal-write-to-read-only-property-array/278485
**Category:** flash
**Created:** [December 30, 2008, 11:16pm UTC](https://forum.kirupa.com/t/referenceerror-error-1074-illegal-write-to-read-only-property-array/278485 "2008-12-30T23:16:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ger11s](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@ger11s](https://forum.kirupa.com/u/ger11s)
#### Post date: [December 30, 2008, 11:16pm UTC](https://forum.kirupa.com/t/referenceerror-error-1074-illegal-write-to-read-only-property-array/278485/1 "2008-12-30T23:16:37Z")

</div>

I’m really sorry if this ends up a no brainer. I’m new to both AS3 and OOP and have spent the last 4 hours getting nowhere.

the code is being used as a document class in an fla (nothing else in the fla yet).

the boiled down code is:

package  
{  
import flash.display.Sprite;

```
public class SimpleMenu extends Sprite
{
	public var btnData:Array;
	
	public function SimpleMenu():void;
	{	
		btnData:Array=new Array("Home","About us","Projects","Clients","Press","Brochure");
		trace (btnData);
	}

}

```

}

the output says:  
ReferenceError: Error #1074: Illegal write to read-only property Array on global.  
at SimpleMenu$cinit()  
at global$init()

I’ve tried every way round that I can think off including the stupid ones.  
I’ve googled it but the errors reported there seem much more complex.
