`
hanyiduo
  • 浏览: 77560 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论

改变errortip的嵌入字体及旋转

    博客分类:
  • Flex
XML 
阅读更多
<?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>

  • 大小: 9.9 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics