问题
I'm using ActionScript 3. Developing in FlashDevelop. I get the following error when I try to do import fl.controls.Label;
Definition fl.controls:Label could not be found.
I'm pretty new to Flash. I had this project working without a glitch. I must have changed something for it to stop recognizing the import. Even Intellisense gives me an option to add fl.controls.Label
回答1:
Controls in the fl.controls namespace are native to Flash Professional.
Although I don't use Flash Develop, this is similar to Flash Builder.
If you had Flash Pro you could create a library of components, then export a SWC library for use in your Flash Develop project. Or, reference Flash Pro's controls.
If this previously worked in your project, perhaps your compiler settings no longer link a required SWC dependency?
Not sure if this will help, but I would follow this in Flash Builder:
Flash Components:
Adding by SWC:
- Right-click on your project in Flash Builder, and go to Properties.
- Select "ActionScript Build Path" from the left.
- Go to the "Libary path" tab now available on the right.
- Click "Add SWC..."
Add libs from Flash such as flash.swc or IK, depending on what version of the Flash IDE you have and where you installed it.
C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\ActionScript 3.0\libs\flash.swc
Adding by source folder:
- Right-click on your project in Flash Builder, and go to Properties.
- Select "ActionScript Build Path" from the left.
- Go to the "Source path" tab now available on the right.
- Click "Add Folder..."
The Flash components should be in a location with a path similar to the following, depending on what version of the Flash IDE you have and where you installed it.
C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\Component Source\ActionScript 3.0\User Interface
...or...
C:\Program Files\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface
Default playerglobal namespace.
Default package / playerglobal.swc reference often is incorrect when editing from Flash in Flash Builder.
In .actionScriptProperties, add:
<libraryPathEntry kind="3" linkType="1" path="${FLASHPRO_APPCONFIG}/ActionScript 3.0/FP10.2/playerglobal.swc" useDefaultLinkType="false"/>
回答2:
If you need general fl.* libraries, copy this swc:
/Applications/Adobe Flash CS6/Common/Configuration/ActionScript 3.0/libs/flash.swc
Into your Flash Builder project using these steps:
来源:https://stackoverflow.com/questions/9492754/definition-fl-controlslabel-could-not-be-found