フレックス トゥーチップにスクロールバーを追加したい。そこで、カスタム ツール ヒントを作成しました。以下はコードスニペットです。私が直面している問題は、マウスをカスタム コンポーネントのツールチップに移動するとすぐに、カスタム コンポーネントのツールチップが消えることです。ToolTipManager.hideDelay = Infinity も設定しました。カスタムツールチップのスクロールバーを使いたいです。マウスをカスタム ツール チップ コンポーネントの外に移動するまで、カスタム ツールの上部を非表示にしたくありません。現在、マウスをラベルの外に移動すると、それ自体が非表示になります。ツールチップの破棄を制御する方法。
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%"
height="100%"
implements="mx.core.IToolTip">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
private var _bodyText:String = "";
[Bindable]
public function get bodyText():String
{
return _bodyText;
}
public function set bodyText(value:String):void
{
_bodyText = value;
text = value;
}
private var _text:String;
public function get text():String
{
return _text;
}
public function set text(value:String):void
{
_text = value;
}
]]>
</fx:Script>
<s:Scroller width="100%" height="200">
<s:RichEditableText text="{bodyText}" width="100%" height="100%" color="red"/>
</s:Scroller>
</s:Group>
そして、このカスタム ツールチップを mx:label コンポーネントの toolTipCreate イベントに追加します。
protected function label1_toolTipCreateHandler(event:ToolTipEvent):void
{
ScrollableToolTip ptt = new ScrollableToolTip();
ptt.bodyText = data.notes;
ptt.height = 300;
ptt.width = 100;
event.toolTip = ptt;
}
任意のポインタ..
ありがとうラージ