beautypg.com

Using flex metadata additional resources, Using flex metadata, Additional resources – Adobe Flash Professional CC 2014 v.13.0 User Manual

Page 681

background image

To the top

To the top

Copy the SWC file from Flash Professional and paste it into the bin folder of your Flex project.

Add the SWC file to library path of your Flex project. For more information, see the Flex Builder documentation at

www.adobe.com/go/learn_flexresources_en

.

Using Flex metadata

If you are writing ActionScript 3.0 code to be used in Flex, you can place metadata in the code to embed external files in any published SWF that
includes the ActionScript code. Usually, these [Embed] metadata declarations are used to embed image files, fonts, individual symbols, or other
SWF files into the SWF.

Remember that metadata is “data about data.” You add metadata to ActionScript on the line immediately preceding the line of code that the
metadata applies to. The compiler then takes the metadata into account when compiling the line of code that follows it.

For example, to embed an image called button_up.png that is stored in the directory one level above the ActionScript file, you would use the
following ActionScript:

[Embed("../button_up.png")]

private var buttonUpImage:Class;

The [Embed] metadata tag tells the compiler to embed the file named button_up.png in the SWF file and that the file should be associated with the
variable named buttonUpImage.

For more information about embedding assets with metadata in Flex, see Embedding Assets in the Flex 3 Developer Guide at

www.adobe.com/go/learn_flexresources_en

.

If you use a feature that requires the Flex SDK, such as [Embed] metadata, at compile time Flash Professional prompts you to add the Flex.SWC
file to the Library path of your FLA file. The Flex.SWC file contains compiled classes needed to support Flex metadata. Click Update Library Path
in the dialog box to add Flex.SWC to the Library path. You can also add the Flex.SWC file to the Library path in the ActionScript publish settings
later.

Additional resources

The following resources provide additional information and examples about integrating Flash Pro with Flash Builder:

Site:

http://jessewarden.com/

Legal Notices

|

Online Privacy Policy

674