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.
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.
Thanks so much! I am moving an application from Flex3 to Flex4 and have encounter this every where. I didn’t realize I was doing it wrong, so you explanation was a huge help.
Thanks again – Cheers,
Steve
Just encountered this error. FlashCS3 Help was no help so Google led me here. Great tip. Simple and concise. Solved my problem. Thank you so very much!
Hi all.
Really good tip.
If you don’t set setter type all works great.
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.
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
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.
Glad I could help Gus.
Cheers, Mate!
Very helpful!!!