=================================
=================================
=================================
출처: http://epiccoding.wordpress.com/2011/07/16/to-import-fl-swz-to-flash-builder/
To import fl.swz to flash builder
reference : http://www.actionscript-flash-guru.com/blog/14-flcontrols-not-found-how-do-i-import-the-fl-package
fl.controls Not Found, How Do I Import The fl Package in ActionScript 3 (AS3)
Last Updated on Tuesday, 18 May 2010 11:47Written by Nicholas Dunbar
Flash components are fantastic as long as you don’t start customizing them. I never used them in AS2 because they would often access the root of my movie and add things that messed with my code. Now with ActionScript3 (AS3) Security settings, I can load components into a seperate SWF which keeps the loaded components influence out of my code. I find the documentation for these flash components to be rather poor. So far the best documentation that I have found resides here:
Also people get confused between using these components in Flash Professional and in Flex Builder. If you are using Flash Pro then you should use the fl package, if you are using flex then you should be using the mx package. There are two ways to import packages from the fl package. For example to use compile time checking of the classes in the fl.controls package you would do the following:
go to the menu window
open the components panel
drag your component into the library
some examples of available components in the fl.controls package would be:
- Use the Button component
- Use the CheckBox component
- Use the ColorPicker component
- Use the ComboBox component
- Use the DataGrid component
- Use the Label component
- Use the List component
- Use the NumericStepper component
- Use the ProgressBar component
- Use the RadioButton component
- Use the ScrollPane component
- Use the Slider component
- Use the TextArea component
- Use the TextInput component
- Use the TileList component
- Use the UILoader component
- Use the UIScrollBar component
If you are coding inside of this FLAs timeline where you have dragged your components, you can just start coding and assume the classes like TIleList will be globally available from the library.
If you are downloading the generated SWF (component.swf) into a seperate SWF (uiControler.swf) which has classes that work with the components in the component.swf then you need to import the classes by adding their class path. Goto control shift F12 (command shift F12 on a mac) in your FLA (uiControler.FLA) or click menu file>publish settings and then under the flash tab click actionscript settings there you can add the class path for the fl package. It will be something like the following in CS3:
C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Component Source\ActionScript 3.0\User Interface\
in CS4 you will need these paths:
C:\Program Files (x86)\Adobe\Adobe Flash CS4\Common\First Run\Classes
C:\Program Files (x86)\Adobe\Adobe Flash CS4\Common\Configuration\ActionScript 3.0\projects\Flash\src\fl
C:\Program Files (x86)\Adobe\Adobe Flash CS4\Common\Configuration\Component Source\ActionScript 3.0
There is also a dynamic way to aquire the classes from the component.swf if you dont want to include the class path in uiControler.swf. This is considered sloppy programming because you remove compile time checking however rules can be broken in some casses. For example what if you are programming a library that relies on these components, you don’t want to distribute a SWC and you don’t want to distribute the fl package. But you will distribute the UI assets in a SWF with the library. This way you avoid having the user drag things on stage or change the class path. They just import your libary and start using it.
Here is an example:
01.
var loaderObject:LoaderInfo = _uiAssets.root.loaderInfo;
02.
// Get the same domain with movie loaded
03.
var domain:ApplicationDomain = loaderObject.applicationDomain;
04.
//dynamic classes
05.
var TileListClass:Class;
06.
var ScrollBarDirectionClass:Class;
07.
var ScrollPolicyClass:Class;
08.
var DataProviderClass:Class;
09.
10.
//get classes for - fl.controls.TileList
11.
// Pull class from file .swf with the same domain
12.
try {
13.
TileListClass = domain.getDefinition ( "fl.controls.TileList" ) as Class;
14.
ScrollBarDirectionClass = domain.getDefinition ( "fl.controls.ScrollBarDirection" ) as Class;
15.
ScrollPolicyClass = domain.getDefinition ( "fl.controls.ScrollPolicy" ) as Class;
16.
DataProviderClass = domain.getDefinition ( "fl.data.DataProvider" ) as Class;
17.
var titleList:Object = new TileListClass();
18.
var dataProvider:Object = new DataProviderClass();
19.
} catch (e:Error){
20.
trace("Error: "+_UI_NAME+" class fl.controls not found "+e.message);
21.
}
=================================
=================================
=================================
'ADOBE > ActionScript' 카테고리의 다른 글
플래시 AS3.0, RESIZE 이벤트를 이용한 화면사이즈 조정 관련 (0) | 2011.12.13 |
---|---|
플래시 fl.controls.TileList 관련, 리스트안에 컨트롤 (0) | 2011.12.09 |
플래시 빌더 4.5 관련 링크 (0) | 2011.11.25 |
[AS] 플래시 FDT 개발툴 관련 설치 or 이모저모 (0) | 2011.11.25 |
[AS] Flash 의 Button Component 를 살펴보고... (0) | 2011.11.24 |