Use an embedded image for the InlineGraphicImage object's source : Embed « Development « Flex






Use an embedded image for the InlineGraphicImage object's source

Use an embedded image for the InlineGraphicImage object's source
         

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



<!-- sparktextcontrols/SimpleEmbed.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>
    <fx:Script>
        [Embed(source="a.gif")] [Bindable] public var imgCls:Class;
    </fx:Script>
    <s:RichEditableText id="richTxt" textAlign="justify" width="100%">
        <s:textFlow>
            <s:TextFlow>
                <s:p>
                    <s:img id="myImage" source="{imgCls}" height="100"
                        width="100" />
                </s:p>
            </s:TextFlow>
        </s:textFlow>
    </s:RichEditableText>
</s:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Create a Button control, and sets its icon property by using the @Embed() directiveCreate a Button control, and sets its icon property by using the @Embed() directive
2.Inline embedded Button Icon
3.Using Embedded icon Class for Button iconUsing Embedded icon Class for Button icon
4.Embed a bitmap (.bmp) file and displays its properties when you click the Show Properties button.
5.Use Embed statement with the SWFLoader controlUse Embed statement with the SWFLoader control
6.Embedding resources in style sheetsEmbedding resources in style sheets
7.Use Embed statement directly in the style sheetUse Embed statement directly in the style sheet
8.Embed boldface, oblique, and plain typefaces
9.Examples of embedding assetsExamples of embedding assets
10.Associate the embedded image with a variable by using [Embed] metadata tagAssociate the embedded image with a variable by using [Embed] metadata tag
11.Using the [Embed] metadata tagUsing the [Embed] metadata tag
12.Create and manipulate an object that represents the embedded image before passing it to a controlCreate and manipulate an object that represents the embedded image before passing it to a control
13.Embed image file to Image controlEmbed image file to Image control
14.Assign embedded image file to Image sourceAssign embedded image file to Image source
15.Embedded StylesEmbedded Styles
16.Skin with Embedded ImagesSkin with Embedded Images
17.Embedding assets from SWF files
18.Like the Image control, use Embed statement with the SWFLoader control to embed the imageLike the Image control, use Embed statement with the SWFLoader control to embed the image
19.Embed a small amount of Hebrew text in a text control, and sets the direction style to rtl.Embed a small amount of Hebrew text in a text control, and sets the direction style to rtl.
20.Embed MP3 file
21.Use the Embed statement directly in the style sheetUse the Embed statement directly in the style sheet
22.Embedding Images InlineEmbedding Images Inline
23.Point to the location of the SWF file with the source property in the Embed statement
24.Embedding skin inline
25.Access Embeded Class Object
26.Embed image into html and display it with RichTextEmbed image into html and display it with RichText