What class are embedded media in Flash Builder?

When you insert media into the FLASH Builder as shown below, it creates a class for the link

[Embed(source="images/list.png")]
protected static const LIST_ICON:Class;

Which class creates this class? And if I had a swc library containing bitmapData, how would I work in code by creating the same class using bitmapData from my swc?

I have a SWC with bitmapData p>

I have an xml file that goes into my file that determines which raster image I use

so I get the class by doing

var ClassReference:Class = getDefinitionByName("ImageData") as Class;

"ImageData" is an example for any text that xml sends ... so it dynamically decides what to select the swc class.

Subsequently, I need to use this to create a class that I think extends BitmapAsset containing the extracted bitmapDates ... in this way, emulating the attachment from the first two lines above.

The end result is that I have a system that calls

getQualifiedClassName(SomeClass)

The class that is passed next uses

getDefinitionByName("passedName") 

to get a class and therefore containing bitmapData.

It is a bit complicated, but I have to do it in such a way that it is dynamic at my end ... I cannot change the code that processes the data passed to it. It must be given by name

I was hoping this would be easier, but I'm starting to think that it would be easier to implement all of this in the usual way and make a simple switch that uses different attachments, depending on what the XML says

+3
source share
3

(http://livedocs.adobe.com/flex/3/html/help.html?content=embed_4.html) Embed, , mx.core.BitmapAsset (.. LIST_ICON BitmapAsset).

, :

[Embed(source="images/list.png")]
protected static const LIST_ICON:Class;

...

var imgObj:BitmapAsset = new LIST_ICON() as BitmapAsset;

.

+2

, var listIcon:LIST_ICON = new LIST_ICON();.

image.source = listIcon;

0

, swf. . (afaik), swf. , TerrainGenerator.as, SWiX, SymbolClass:

<SymbolClass>
    <Symbol Tag="0" Name="TerrainGenerator" />
</SymbolClass>

, . , Embed

public class TerrainGenerator {
    [Embed(source="SOME_PNG.PNG")]
    public static const IMAGE_RESOURCE:Class;
...

:

<SymbolClass>
    <Symbol Tag="1" Name="TerrainGenerator_IMAGE_RESOURCE" />
    <Symbol Tag="0" Name="TerrainGenerator" />
</SymbolClass>

Embed resource somepackage, :

 <Symbol Tag="1" Name="somepackage.resource_IMAGE_RESOURCE" />

, , swf-.

0

All Articles