In Flex and Flashide we can [Embed (source= "...")] embed resources such as images and SWF, but there are different ways to embed them.
Flex Example:
[Embed (Source="). /assets/images/embed/bg_top_v.png "publicvar bg_top_v:class;
Flash Example:
[Embed (Source="/. /assets/images/embed/bg_top_v.png "publicvar bg_top_v:class;
".. /" indicates that a lookup is started from the parent directory of the publishing directory, and this string is not required if the resource is in a sibling directory of the publishing directory.
Note the difference between the two, and you must also set up the Flex SDK in the Flash IDE, because the [Embed (source= ...]] method itself belongs to the functionality of the Flex SDK.
Also attached are methods for embedding other types of data:
"/.. /assets/app/weather/config/city.xml"" Application/octet-stream ")]publicvar
When embedding XML data, you must set the MimeType parameter to "Application/octet-stream". Flash cannot detect the correct MIME type through the extension of the XML file, so you set the mimetype parameter whenever you embed the XML data.
[Embed (source="Arial bold.ttf", fontname="MyFont", fontweight="Bold", advancedantialiasing="True", mimetype="Application/x-font")] public var
When embedding font data, Source: This parameter indicates the location of the font file. If you prefer, you can use the Systemfont parameter to confirm the name instead of the source to embed the system font. FontName: This parameter indicates the name of the embedded font, and the name of the font is a unique identifier, so you can call the font by name. MimeType: This parameter describes the MIME type of the embedded metadata. Because you embed a font in this example, you can set the MIME type to "Application/x-font". FontWeight: This parameter indicates the weight of the font, such as bold or normal.
Note: If the font has a thickness and you do not include the fontweight parameter in the [Embed] metadata label, when the test SWF file is, you will see the following compilation error:
Exception during Transcoding:font for alias ' MyFont ' with plain weight and style is not found at ... (Unexpected conversions: fonts with a thickness and style alias of ' MyFont ' are not found in ...)
[Flash&flex] AS3.0 How to embed resources using [Embed (Source= ... ")]