zoukankan      html  css  js  c++  java
  • Adding links to a Panel container’s status text in Flex

    The following example shows how you can assign an HTML formatted string to a Panel container’s status text field using the getStatusTextField() method in the mx_internal namespace.

    Full code after the jump.

    Since this example uses the mx_internal namespace, you can’t always depend on this behavior to work in future versions of the Flex SDK. Use at your own risk.

    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2008/04/17/adding-links-to-a-panel-containers-status-text-in-flex/ -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout
    ="vertical"
            verticalAlign
    ="middle"
            backgroundColor
    ="white"
            creationComplete
    ="init();">

        
    <mx:Script>
            
    <![CDATA[
                import mx.core.IUITextField;
                import mx.controls.Alert;

                private function init():void {
                    var tf:IUITextField = panel.mx_internal::getStatusTextField();
                    tf.selectable = true;
                    tf.addEventListener(TextEvent.LINK, textField_link);
                    tf.htmlText = "status with <a href='event:showAlert'><u>link</u></a>";

                }

                private function textField_link(evt:TextEvent):void {
                    Alert.show("Success! A Panel container with a link in the status text.", evt.text);
                }
            
    ]]>
        
    </mx:Script>

        
    <mx:Panel id="panel"
                title
    ="Title"
                status
    ="status with link"
                width
    ="320"
                height
    ="240">
            
    <mx:Text text="Click the link in the Panel container's status bar to launch an Alert control."
                    width
    ="100%" selectable="false" />
            
    <mx:ControlBar>
                
    <mx:Text htmlText="&lt;b&gt;Note:&lt;/b&gt; The status text field must have it's selectable property set to true in order to dispatch the link event."
                        width
    ="100%" selectable="false" />
            
    </mx:ControlBar>
        
    </mx:Panel>

    </mx:Application>

  • 相关阅读:
    localstorage和sessionstorage的区别
    vue监听数组变化
    博客项目之设计访客统计
    记录从前端到后端--博客项目
    把w3schools英文版的所有属性扒下来了,免费分享。
    记一次博客园改版,如果你想做的漂亮点的话。
    我有话说
    彻底理解nth-child和nth-of-type的区别。
    前端这条路,我们该何去何从,续集
    一篇通俗易懂的CSS层叠顺序与层叠上下文研究
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1167844.html
Copyright © 2011-2022 走看看