Flex: 1120: Access of undefined property com

2 06 2008

OK, so I’m getting a little tired of this error.

If you too are seeing the hateful “1120: Access of undefined property …” without a line number in Flex, maybe I can help.

I’ve noticed strange happenings when in an ActionScript class, I import MXML components of my own design (I oft for the com namespace). I can’t say why this causes an error, and I cannot easily replicate it, but needless to say, this issue has kept me up. Generally, in my main script file, I have to use a redundant import statement to remove it.

So I have

import com.justinjmoses.packagename.*;

import com.justinjmoses.packagename.SomeClass;

Whenever I modify the main script file, it removes this redundant second import and then throws up the cryptic 1120 error without a line number to help. Imagine the woes for the next developer to work on the product if I didn’t document this highly unusual behaviour.

Another thing I found was once, in a module, importing MXML components and then intiatialising them in actionscript, was causing all my tool tips to die. Weird, huh? Literally, every time you’d navigate to the SWF, no matter the browser, all the tooltip data was removed, leaving small blank boxes. However, if you refreshed, the issue would intermittently go away.

Eventually I traced it to importing MXML classes into my actionscript, though I couldn’t identify exactly what part of it was causing the issue.

Unfortunately, this isn’t one of those small things you can replicate and post to Adobe, but hopefully we can all help each other out with this one.

If you’ve had this issue yourself, please add a comment about it. (Otherwise I’ll get paranoid it’s just me 😉




3 responses

22 05 2009
Sanda S.

Me too 🙂 Haven’t solved it yet.

4 09 2009

Flex and actionscript sucks. Dumb errors like are just stupid in a programming language.

14 09 2010

I got also the 1120 error + import a.*
You saved my life!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: