• 在MXML代码中,而不是ActionScript中,实现接口


    Implementing the IToolTip interface

    You can also create a custom ToolTip by extending an existing control, such as a Panel or other container, and implementing the IToolTip interface. The following example uses a Panel container as the base for a new implementation of the IToolTip interface:



     1 <?xml version="1.0"?>
     2 <!-- tooltips/ToolTipComponents/PanelToolTip.mxml -->
     3 <s:Panel 
     4     xmlns:fx="http://ns.adobe.com/mxml/2009"    
     5     xmlns:mx="library://ns.adobe.com/flex/mx"     
     6     xmlns:s="library://ns.adobe.com/flex/spark"
     7     implements="mx.core.IToolTip" 
     8     width="200" 
     9     alpha=".75">
    10     <fx:Script>
    11         <![CDATA[
    12             [Bindable]
    13             public var bodyText:String = "";
    14 
    15             //  Implement required methods of the IToolTip interface; these 
    16             //  methods are not used in this example, though.
    17             public var _text:String;
    18 
    19             public function get text():String { 
    20                 return _text; 
    21             } 
    22             public function set text(value:String):void {
    23             } 
    24         ]]>
    25     </fx:Script>
    26 
    27     <s:RichText text="{bodyText}" percentWidth="100"/>
    28 
    29 </s:Panel>
  • 相关阅读:
    mysql资料
    MySQL启动与关闭
    poj 2778 DNA Sequence
    poj 1625 Censored!
    zoj 3228 Searching the String
    hdu 4605 Magic Ball Game
    hdu 4610 Cards
    SGU 439 A Secret Book
    NOI2013
    NOI2014
  • 原文地址:https://www.cnblogs.com/iihe602/p/2100980.html
Copyright © 2020-2023  润新知