ReferenceError: Error #1056: Cannot create property _x on flash.display.Sprite
or
ReferenceError: Error #1056: Cannot create property someVar on flash.text.TextField.
ActionScript 3 Error #1056 Description:
AS3 error 1056 appears when you have improperly referenced a property of an object. This will happen when you misspell something or when you reference variables in the AS2 fashion with a leading underscore ( _ ). AS3 error 1056 is actually pretty nice to work with because it tells you exactly what variable didn’t work and it tells you which object it didn’t work on.
You can also get this error if you try to dynamically assign a variable to an object that doesn’t naturally accept one like a textField. See Bad Code 3.
Flash / Flex Error 1056 Fix:
Simply spell the property correctly or make sure that you are using AS3 Syntax instead of AS2.
Bad Code 1:
var s = new Sprite();
s._x = 100;
Good Code 1:
var s = new Sprite();
s.x = 100;
Bad Code 2:
var t = new Timer(1000, 4);
t.dela = 500;
Good Code 2:
var t = new Timer(1000, 4);
t.delay = 500;
Bad Code 3:
myTextField.someVar = “something”;
This should help you resolve Flex / Flash Error #1056
Thanks and as always Happy Flashing
Curtis J. Morley
Related ActionScript Error(s):
Flash / Flex Error 1119 – You will get AS3 Error 1056 instead of 1119 if you don’t properly type your object before referencing a property on it. For example var s:Sprite = new Sprite(); s._x = 10; will give error 1119 but var s = new Sprite(); s._x = 10; will give Error 1056.
Flash / Flex Error 1151
Flash / Flex Error 1069 – This is the error you will get if you try and call a method with a misspelled name in the same way as calling a property with a misspelled name.