Flex的tool tips中使用嵌入字体的例子
2009-11-11 13:35
537 查看
Flex具有很强的表现力,除了可以将枯燥的数字用形象的图表来描画,而个性化字体的使用增加了其表现力。下面的例子演示了如何如何在一个tool tip中使用嵌入的字体。
让我们先来看一下Demo,输入框得到焦点或者鼠标移到输入框上(可以右键View Source或点击这里察看源代码
)
Download: main.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"> <mx:Style> @font-face { src: local("Comic Sans MS"); fontWeight: normal; fontFamily: ComicSansMSEmbedded; } .errorTip { border-style: "errorTipAbove"; fontFamily: "ComicSansMSEmbedded"; fontSize: 12; fontWeight: normal; } </mx:Style> <mx:Script> <![CDATA[ import mx.events.ToolTipEvent; import mx.controls.ToolTip; private function init():void { ToolTip.maxWidth = textInput.width; } private function textInput_toolTipShown(evt:ToolTipEvent):void { var tt:ToolTip = evt.toolTip as ToolTip; tt.x = textInput.x; tt.y = (textInput.y - tt.height); tt.rotation = 5; } ]]> </mx:Script> <mx:TextInput id="textInput" text="{new Date().toDateString()}" errorString="The quick brown fox jumped over the lazy dog" toolTipShown="textInput_toolTipShown(event);" /> </mx:Application>
相关文章推荐
- Flex中通过设置fontFamily和labelStyleName样式在HSlider控件中使用嵌入字体的例子
- Flex中如何通过设定headerStyleName样式在Accordion控件中使用嵌入字体的例子
- Flex中如何通过设置fontFamily样式在NumericStepper控件中使用嵌入字体的例子
- Flex中通过设定fontFamily和fontWeight样式在TabBar控件中使用嵌入字体的例子
- Flex中如何通过设置fontFamily样式在ComboBox控件中使用自定义嵌入字体的例子
- Flex中通过设置fontFamily样式在调色板(ColorPicker)控件中使用自定义嵌入字体的例子
- 在flex中如何使用嵌入字体
- Flex中检测应用程序是否嵌入某种特定字体的例子
- 在flex中如何使用嵌入字体
- 在Flex中使用嵌入字体鲜为人知的秘密
- 检测Flex应用程序中嵌入了哪种字体(fonts)的例子
- 在Flex中使用其他字体 Flex嵌入字体
- Flex应用中利用Embed metadata(redux)的systemFont属性嵌入字体(font)的例子
- flex 嵌入字体的使用
- flex中使用设备和嵌入字体
- 在Flex中使用嵌入字体鲜为人知的秘密
- Flex应用中如何利用source属性嵌入字体的例子
- flex中使用设备和嵌入字体
- 在Flex中使用嵌入字体
- 使用@font-face 属性 实现在网页中嵌入任意字体