
Envoyé par
ASDoc, classe Image, propriété source
source property
source:Object [read-write]
The URL, object, class or string name of a class to load as the content. The source property takes the following form:
source="
URLOrPathOrClass
"
source="@Embed(source='
PathOrClass
')"
The value of the source property represents a relative or absolute URL; a ByteArray representing a SWF, GIF, JPEG, or PNG; an object that implements IFlexDisplayObject; a class whose type implements IFlexDisplayObject; or a String that represents a class.
When you specify a path to a SWF, GIF, JPEG, PNG, or SVG file, Flex automatically converts the file to the correct data type for use with the SWFLoader control.
If you omit the Embed statement, Flex loads the referenced file at runtime; it is not packaged as part of the generated SWF file. At runtime, the source property only supports the loading of GIF, JPEG, PNG images, and SWF files.
Flex Data Services users can use the SWFLoader control to load a Flex application by using the following form:
source="
MXMLPath
.mxml.swf"
Flex Data Services compiles the MXML file, and returns the SWF file to the main application. This technique works well with SWF files that add graphics or animations to an application, but are not intended to have a large amount of user interaction. If you import SWF files that require a large amount of user interaction, you should build them as custom components.
Partager