08.20.07

Flash CS3 / Flex AS3 Error #1053

Posted in Computers, Flash, Flex, errors, quicktip at 11:01 pm by Curtis J. Morley

ActionScript Error #1053: Accessor types must match.

Description:
This is a great error that has absolutely no documentation. This is what Adobe has to say about it.

The non-error error.  ActionScript Error #1053 from Adobe Live Docs
Notice how the right side of the image doesn't have any text at all. It is simply left blank. To understand this error you need to understand what an 'Accessor' is. An 'Accessor' is a 'Getter' that accompanies a 'Setter'. The reason it is called an 'Accessor' is because it accesses the variable set using a 'Setter'.

So what does that mean for you. This error means that the Getter(Accessor) is not set as the same Type as the Setter.

Fix:
Make sure that whatever you return in the 'Getter' is the same 'Type' as what is set in the 'Setter'.

Bad Code:

function get sClickable():String {
return _clickable.toString();
}
function set sClickable(myClickable:Boolean):void {
this._clickable=myClickable;
}

Good Code:

public function get sClickable():Boolean {
return _clickable;
}
public function set sClickable(myClickable:Boolean):void {
this._clickable=myClickable;
}

So now you know how to solve ActionScript Error #1053.

As Always Happy Flashing.

5 Comments »

  1. Gus said,

    September 12, 2007 at 7:13 pm

    Cheers, Mate!

    Very helpful!!!

  2. Curtis J. Morley said,

    September 18, 2007 at 7:15 pm

    Glad I could help Gus.

  3. Brady White said,

    October 18, 2007 at 3:27 pm

    Curtis, thanks for the post, helped me know what this error was. You are #1 on google for this error ;) Just an FYI, regarding your blog’s css design, the inset drop shadow box around your content is overlapping into your navigation on the right in Firefox on PC.

  4. Curtis J. Morley said,

    October 18, 2007 at 8:15 pm

    Thanks Brady. Good to hear from you again. Hope things are going well. Thanks for the tip on the CSS. That is the way it is designed. If you have a quick fix that would push it over I would love to try it.

    Thanks,
    Curtis J. Morley

  5. Yogarine said,

    July 22, 2008 at 5:21 am

    Thanks for the tip. Simple, and straight to the point. Flex Builder had me gazing at the monitor for a couple minutes trying to figure out what the hell I was doing wrong, hehehe.

Leave a Comment