ActionScript 3 as3 textformat

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 as3 textformat相关的知识,希望对你有一定的参考价值。

import flash.text.TextFormat
			
		public var over_style = new TextFormat();
		public var out_style = new TextFormat();
		
		over_style.color = 0xFF0000; // Red
		out_style.color = 0x0000FF; // Black

		mcRolls.rollCount.text = "Hello World";
		mcRolls.rollCount.setTextFormat(out_style);
		mcRolls.rollCount.mouseEnabled = false; // This allows the hand to show up for dynamic textfields
		mcRolls.buttonMode = true;
		mcRolls.addEventListener(MouseEvent.MOUSE_OVER, OVER_Handler);
		mcRolls.addEventListener(MouseEvent.MOUSE_OUT, OUT_Handler);

		function OVER_Handler(e:MouseEvent):void
		{
		var mc:MovieClip = e.currentTarget as MovieClip;
		mc.rollCount.setTextFormat(over_style);
		}

		function OUT_Handler(e:MouseEvent):void
		{
		var mc:MovieClip = e.currentTarget as MovieClip;
		mc.rollCount.setTextFormat(out_style);
		}

以上是关于ActionScript 3 as3 textformat的主要内容,如果未能解决你的问题,请参考以下文章

[ActionScript 3.0] AS3.0 水面波纹效果

ActionScript 3 AS3:使用SWFObject2和AS3传递变量

ActionScript 3 克隆数组(AS3)

ActionScript 3 AS3序列化

ActionScript 3 As3初始上限

ActionScript 3 AS3 HTML清理