imagetype.as

来自「as30的详细例子,包含了大量的例子,是不可多得的学习AS3的好资料」· AS 代码 · 共 45 行

AS
45
字号
package com.example.programmingas3.filterWorkbench
{
	/**
	 * Combination value object and enumeration class whose values represent 
	 * the types of images that are available to be used as filter targets 
	 * in the FilterWorkbench application.
	 */
	public class ImageType
	{
		public static const IMAGE1:ImageType = new ImageType("Bitmap image 1", "images/sampleImage1.jpg");
		public static const IMAGE2:ImageType = new ImageType("Bitmap image 2", "images/sampleImage2.jpg");
		public static const SWF:ImageType = new ImageType("SWF animation", "images/sampleAnimation.swf");
		
		
		public static function getImageTypes():Array
		{
			return new Array(IMAGE1, IMAGE2, SWF);
		}
		
		// ------- Private vars -------
		private var _name:String;
		private var _url:String;
		
		
		// ------- Constructor -------
		public function ImageType(name:String, url:String)
		{
			_name = name;
			_url = url;
		}
		
		
		// ------- Public properties -------
		public function get name():String
		{
			return _name;
		}
		
		
		public function get url():String
		{
			return _url;
		}
	}
}

⌨️ 快捷键说明

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