explorers’ club


Fix: “1120: Access of undefined property Bindable”
Monday, March 19, 2007, 8:38 pm
Filed under: actionScript, development, flash, flex

Remember when you were told to end your sentences with punctuation in grammar school? If you are coming from and ActionScript background, you may have gotten lazy about ending your sentences with the AS equivalent of the period:”;”.

Normally the compiler doesn’t gripe about it. Much like your dear ol’ teacher, it grades your code on content and syntax rather than punctuation. However in the case of the metatags being inside the body of the script or class, it doesn’t like it. Here’s an example:

[Bindable]
public var t:Boolean = true
[Bindable] //will throw the error here
public var s:Boolean = false;

To fix that you simple need to make sure the ; was on the sentence above like so:

[Bindable]
public var t:Boolean = true;
[Bindable] //you get an A+ Timmy
public var s:Boolean = false;

I haven’t done any testing on if this is only applicable for mxml based components simply because I am lazy. Maybe later.

UPDATE (5 minutes later):
So I am feeling a bit inspired. I ran the same test on an ActionScript class and lo and behold I get “An internal build error has occurred. Please check the Error log.” Now I am feeling lazy again (really I forgot where to find the log file) and so i will break again. Teacher???? what gives???


9 Comments so far
Leave a comment

Thanks – that could’ve turned into a nasty red herring

Comment by Will Myers

I am getting “1120: Access of undefined property ac” for the following code:

public var ac:Animation = new Animation(’APPLE’);
ac.say();

>:?//

Comment by Donkey

I don’t know the API for the Animation class so I can’t really say what the issue is specifically.

But an 1120 error is simply an error that something referred is undefined. It matters not whether it be the [Bindable] metatag or the use of your Animation class.

Start looking at your class path to ensure you are actually creating the instance var.

Comment by jwopitz

when i’m writing in AS3 normally I return an 1120 error if I put a ; at the end of the private function statement

hope this helps….

Comment by wishin4gucci

I return an 1120 error on this code:

this.createEmptyMovieClip(”holder_mc”,this.getNextHighestDepth());
{
var i:Number=1;
while(i<100) {
var t:MovieClip = holder_mc.attachMovie(”Rock”,”Rock”+i,this.getNextHighestDepth());
t._y = Math.random()*stage.height;
t._x = Math.random()*stage.width;
i++;
}
}

please point out specifically where I am wrong, or if I am not.

Comment by Iboy

Can you post the entire code where this is defined and how you are executing it. Also, this looking like flash rather than flex, I will need to see the details associated with the error code.

j

Comment by jwopitz

Check out this post for a possible solution:

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=587&threadid=1327210&enterthread=y

Comment by Ed J.

I’m also getting a 1120 error with this code:

Btn1.addEventListener(MouseEvent.CLICK, click);
function click(evt:MouseEvent):void {
var url:String = “http://www.epicsen.com”;
var request:URLRequest = new URLRequest(url);
navigateToURL(request, ‘_self’);
}

This is using actionscript 3 with flash CS3. Can anyone help? =]

Comment by Amm0

Thank you! confused me for long time

Comment by iShrek




Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>