Flex / Flash ActionScript Error #1059: Property is read-only.

AS3 Error 1059: Property is read-only

ActionScript Error 1059 Description

ActionScript 3 Compiler Error 1059 just means that you are trying to write to something that is read only. Flash/Flex let’s you know that you are assigning a variable while at the same time evaluating to see if it is true. This AS3 Error is easy to understand and correct.

ActionScript Error 1059 Solution:The fix for Flex/Flash Error 1059 is to make sure that you are writing to writable property and not trying to write to a read only property. This is shown in two ways below.

Bad Code 1:

if(textName.length = 5)

Good Code 1:

if(textName.length == 5)

Bad Code 2:

var occurence:SharedObject = new SharedObject()occurence.data = “first”;

Good Code 2:

var occurence:SharedObject = new SharedObject()occurence.data.whichTime = “first”;

And now you know how to solve Flex /Flash Error 1059.

As Always – Happy Flashing

Curtis J. Morley