View Full Version : how to import/use fl.controls
hbarnett
03-06-2010, 01:22 AM
I am trying to create some controls like radio buttons and combo boxes.
I am using only the mxmlc compiler from the command line.. Not Flex Builder.
When I have an import such as:
import fl.controls.RadioButton;
I get:
Error: Definition fl.controls:RadioButton could not be found.
I have searched for info on this and have found that these controls must be added to the library, but everything I have found describes how to do this in Flex Builder.
Can anyone tell me how to do this when using the command line sdk.. Thanks.
tadster
03-06-2010, 01:33 AM
The fl package is not available with the sdk, the fl package only comes with the flash IDE, if you had CS3 or 4 you could copy the fl folder, to where your flex project is, and then you would be able to use it.
hbarnett
03-06-2010, 01:15 PM
thanks Tadster.. I'm still not understanding this, because if I create an .mxml file with contrlos like radio buttons, etc and compile that with mxmlc, I get the controls in the resulting .swf file. So the libraries for these controls must be in the command line sdk, somewhere..
What I would like to do is create instances of these controls directly in an actionscript file..
tadster
03-06-2010, 02:10 PM
Those are "mx.controls" you'll be importing from the mx package.
http://livedocs.adobe.com/flex/3/langref/mx/controls/package-detail.html
MSLourens
03-09-2010, 07:41 AM
You could create your own swc file with all the flash controls, so you could import the flash controls in your flex project by doing this:
1. Start the Flash IDE
2. Create a new Actionscript 3 file
3. Drag all the controls (radio button, checkbox etc.) to the document library.
4. Go to File --> Publish Settings, go to the Flash tab, check 'export to swc' and hit Publish
5. Copy the published swc to your Flex project and add it to your library.
Now you can import your library with the following line of code:
import flash.controls.*
tadster
03-09-2010, 11:18 AM
if you have the Flash IDE there is no reason to do all that swc stuff, just copy the fl folder from wherever it is amongst your CS(3/4) installation to wherever you are compiling your flex app from, and, wala.. now you can import fl.controls.*
it's just a folder with a bunch of ActionScript files.
the same works for the mx package folder, copy it from wherever your flex (SDK) stuff is, into your IDEs path folder, and then you'll be able to import mx stuff in the IDE...
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.