tags:

views:

448

answers:

1

I'm trying to do a simple import into an ActionScript Project that I've created in Flex Builder:

import mx.controls.Label;

It won't let me. Code hinting shows no 'controls' after mx.

Any idea what's going on?

Thanks.

+3  A: 

To access mx libraries in an Actionscript Project, you need to point Flex Builder to the source path.

Right click on your Project -> Properties -> Actionscript Build Path -> Source path tab -> Add Folder... -> 'C:\Program Files\Adobe\Flex Builder 3\sdks\SDK_VERSION_NUMBER_HERE\frameworks\source\'

and now you can access all the mx.* classes.

JStriedl
Thanks, JStriedl. You're a hero. :) In fact there seems to be no src folder for my sdk # so I just did this, which worked:C:\Program Files\Adobe\Flex Builder 3\sdks\flex_sdk_3.4.0.9271\frameworksA more general question: How did you know this? I've been working in Flex for 2 years and am amazed at how many things seem utterly random. Is there some larger, organized knowledge base that you drew on to know this? It's kind of 'outside of flex' if you know what I mean... having to do with its configuration. Where can I learn it? Any insights appreciated...
David
I learned it by going through a very similar problem (with different symptoms) to what you had. In my case, when migrating an old Flex project to a new version of the Flex Builder, something broke because of the awkward way I was misusing a class, and enough trial and error led me to figure out that the 'problem' was the missing source path. I wish I knew of some central body to learn this stuff, most of the little tidbits I've had to painfully discover for myself, or mine google for random forum/blog posts of fellow frustrated developers ;)
JStriedl
Well, this is weird. I spoke a bit too soon. Code hinting is there, all right, but when I then try to run the app I still get 'Definition could not be found.' Then I tried 3/sdks/flex_sdk_3.4.0.9271/frameworks/projects/flex/src but that had the same effect.
David
OK, here's what worked. FWIW this may help someone else who's got SDK 3.4....C:\Program Files\Adobe\Flex Builder 3\sdks\flex_sdk_3.4.0.9271\frameworks\projects\framework\srcThanks again for your help. We ought to come up with a way to centralize these kinds of issues I think it should have something to do with tagging and 3D. :)
David
Sorry folks, still not working. I should have tested better. What happens now is that code hinting works, and I can compile and run the project with the import statements. However, as soon as I actually instantiate one of the imports, I get a series of errors:Unable to resolve resource bundle "core" for locale "en_US". Unable to resolve resource bundle "effects" for locale "en_US". Unable to resolve resource bundle "skins" for locale "en_US". Unable to resolve resource bundle "styles" for locale "en_US".
David
try adding the Library Path as well as the source path. Right click Project -> Properties -> Actionscript Build Path -> Library Path tab -> Add SWC Folder... and picking 'C:\Program Files\Adobe\Flex Builder 3\sdks\flex_sdk_3.4.0.9271\frameworks\libs'
JStriedl