⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 thumbnailrenderer.mxml

📁 flex 实现的一个showcase 喜欢flex的朋友可以
💻 MXML
字号:
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox 
	xmlns:mx="http://www.adobe.com/2006/mxml"
	
	backgroundColor="0xffffff"
	
	verticalScrollPolicy="off"
	horizontalScrollPolicy="off"
	
	horizontalAlign="center"
	verticalAlign="middle"
	
	paddingLeft="{padding}"
	paddingRight="{padding}"
	paddingTop="{padding}"
	paddingBottom="{padding}"
	
	creationComplete="creationCompleteHandler(event)">
	
	
	<mx:Script>
		<![CDATA[
		
			//////////////////////////////////////////////////
			//import
			
			import com.flexShowcase.data.Project;
			
			//////////////////////////////////////////////////
			//static constants
			
			private static const padding:uint = 3;
			
			//////////////////////////////////////////////////
			//private variables
			
			private var __project:Project;
			private var currentURLObject:Object;
			
			//////////////////////////////////////////////////
			//public variables
			
			//////////////////////////////////////////////////
			//GETTER/SETTERS
			
			[Bindable] public function set project(val:Project):void{
				this.__project=val
				this.handleProject()
			}
			
			public function get project():Project{
				return this.__project
			}
			
			private function handleProject():void{
				this.loadThumbnail()
				
			}
			
			
			//////////////////////////////////////////////////
			//initialization
			
			private function creationCompleteHandler(event:Event):void {
				var glowFilter:GlowFilter = new GlowFilter(0x000000, 0.25, 5, 5, 2, 1);
				filters = new Array(glowFilter);
			}
			
			
			//////////////////////////////////////////////////
			//public functions
			
			public function loadThumbnail():void{
				
				if(this.project!=null){
					thumbnail.load(project.thumbnail);
				}	
			}
			
			//////////////////////////////////////////////////
			//private functions
			
			private function completeEvent(event:Event):void {
				Bitmap(event.target.content).smoothing = true;
				
				thumbnail.content.width = thumbnailContainer.width;
				thumbnail.content.height = thumbnailContainer.height;
			}
			
			
		]]>
	</mx:Script>
	
	
	<mx:Fade id="fadeIn" alphaFrom="0" alphaTo="1.0" duration="1000" />
	
	<mx:Canvas id="thumbnailContainer" width="100%" height="100%" backgroundColor="0xcccccc">
		<mx:Image id="thumbnail" source="{project.thumbnail}" horizontalCenter="0" width="100%" height="100%" 
			alpha="0"  maintainAspectRatio="false" scaleContent="false" completeEffect="fadeIn" complete="completeEvent(event)" />
	</mx:Canvas>
	
	
</mx:HBox>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -