
转载请保持文章完整性!
本文链接地址:http://blog.desizen.com/4lone/564.html
主页:joel's blog
这个例子进行的是Tourdeflex:UI Controls:Other Controls:Image
文中用到的图片下载地址:点此下载,下载后整个images文件夹放到src目录即可.其实只是用到了二张图片.
简介:
The Alert control is a pop-up dialog box that can contain a message, a title, buttons (any combination of OK, Cancel, Yes, and No) and an icon. The Alert control is modal, which means it will retain focus until the user closes it.
例子:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalAlign="top" horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="5" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ private function smoothImage(ev:Event):void{ //set image smoothing so image looks better when transformed. var bmp:Bitmap = ev.target.content as Bitmap; bmp.smoothing = true; } ]]> </mx:Script> <mx:Panel title="Image Samples" layout="horizontal" color="0xffffff" borderAlpha="0.15" paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center"> <mx:VBox width="100%" borderColor="0xACACAC" borderThickness="1" borderStyle="solid" horizontalAlign="center" paddingTop="5" paddingRight="5" paddingBottom="5" paddingLeft="5" > <mx:Text color="0x323232" text="Sample of image embeded at compile time." /> <mx:Image id="embededImage" source="@Embed('images/compass.jpg')" creationComplete="smoothImage(event);"/><!--原来使用@是在编译的时候就嵌入的--> </mx:VBox> <mx:VBox width="100%" borderColor="0xACACAC" borderThickness="1" borderStyle="solid" horizontalAlign="center" paddingTop="5" paddingRight="5" paddingBottom="5" paddingLeft="5"> <mx:Text color="0x323232" text="Sample of image loaded at run-time." /> <mx:Image id="loadedImage" source="images/backpack.jpg" creationComplete="smoothImage(event);"/><!--而这个不加@是在运行时才载入--> </mx:VBox> </mx:Panel> </mx:Application>
标签:FLEX, Image, TourDeFlex, 例子
