![MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Скачать руководство пользователя страница 19](http://html1.mh-extra.com/html/macromedia/flex-developing-components-and-themes/flex-developing-components-and-themes_manual_3388115019.webp)
Exporting components
19
Using the SWCRepair utility
If your new component extends a component that is not native to the Flash environment (but is
instead in the Flex Components list), you must run the SWCRepair utility against the SWC file
when you finish exporting it from Flash and before you use it in Flex. This applies mostly to
containers, since they are not normally used in Flash.
The SWCRepair utility updates a Flash SWC file for use in Flex; the FlexforFlash.zip file includes
the SWCRepair utility. This file is described in
“Adding Flex classes and components to the Flash
IDE” on page 8
.
When you expand the FlexforFlash.zip file, the SWCRepair utility is expanded to
Flash_root
/en/
First Run/SWCRepair/bin/. The default location is C:/Program Files/Macromedia/Flash MX
2004/en/First Run/SWCRepair/bin/SWCRepair.exe.
The SWCRepair utility has the following syntax:
SWCRepair
SWC_filename
[
Flash_root/
en/First Run/Components/Flex Components]
For example:
C:/Program Files/Macromedia/Flash MX 2004/en/First Run/SWCRepair/bin/
SWCRepair.exe C:/myProjects/myComponent.SWC
The SWCRepair utility assumes that Flash is installed in C:/Program Files/Macromedia/Flash
MX 2004. If this is not the actual path, a second argument to the program specifies the Flex
Components directory. For example, if Flash is installed in D:/MM/Flash, you would run the
SWCRepair utility as the following example shows:
D:/MM/Flash/en/First Run/SWCRepair/bin/SWCRepair.exe C:/myProjects/foo.swc
"D:/MM/Flash/en/First Run/Components/Flex Components"
After you run the SWCRepair utility against a SWC file, check whether a log file was created. The
log file name is the same as the SWC filename and appears in the same directory as the SWC file.
For example, if the SWC file is C:/myProjects/foo.swc, the log file is C:/myProjects/foo.log.
If the SWCRepair utility does not generate a log file, check the program arguments and rerun
the utility.
Adding SWC files to Flex
After you generate a SWC file, you must store it in a location that Flex can access so you can use
the SWC file in your Flex applications.
To use a SWC file in your Flex application, save it to a directory defined by the
<compiler>
tag’s
<lib-path>
child tag in the flex-config.xml file. The following example from the flex-config.xml
file adds the /WEB-INF/flex/myswcs directory to the
<lib-path>
setting, in addition to the
user_classes and frameworks directories:
<compiler>
...
<lib-path>
<path-element>/WEB-INF/flex/myswcs</path-element>
<path-element>/WEB-INF/flex/user_classes</path-element>
<path-element>/WEB-INF/flex/frameworks</path-element>
</lib-path>
<compiler>
Содержание FLEX - DEVELOPING COMPONENTS AND THEMES
Страница 1: ...Developing Flex Components and Themes in Flash Authoring ...
Страница 4: ...4 Contents ...
Страница 44: ...44 Chapter 2 Creating Basic Components in Flash MX 2004 ...
Страница 82: ...82 Index ...