
<mx:String>megan5.jpg</mx:String>
</mx:Array>
<mx:List id="ctlImage" dataProvider="{images}"
selectedIndex="0" width="100" />
<mx:Image source="{ctlImage.selectedItem.valueOf()}"
height="200" />
</mx:Application>
At the top of the application is the list of images—in this case,
five images of my daughter Megan that I have included in the
project by dragging and dropping them into Flex Builder in the
src directory.
I then use an mx:List control to display the list of image names,
and an mx:Image tag to display the currently selected image.
Flex actually does the event handling to change the source of
the image for me when the list changes.
When I run this from Flex Builder I see something similar to
Figure 6-4.
Figure 6-4. The very simple image viewer
I can click on the list and see the different images that I have
placed in the src directory with the MXML application. The
84 | Chapter 6: More Flex Applications
Komentáře k této Příručce