Flex Demo 3 - Load Images at Runtime

View Flex Demo 3

This sample demonstrates a simple image display application. A DropDownList component displays a list of image names:
<s:DropDownList id="ddl" x="10" y="10" selectedIndex="0"> 
        <s:dataProvider> 
            <s:ArrayList> 
                <fx:String>pic1.jpg</fx:String> 
                <fx:String>pic2.jpg</fx:String> 
                <fx:String>pic3.jpg</fx:String> 
            </s:ArrayList> 
        </s:dataProvider> 
    </s:DropDownList> 
And an Image component is configured to display whichever image is selected. Note that the images are loaded at runtime, and not before.
    <mx:Image x="10" y="39" source="http://jimhalliday.net/local/pics/{ddl.selectedItem}"/>
(That's my son Griffin in the pictures!)