<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; createToolTip()</title>
	<atom:link href="http://blog.flexexamples.com/tag/createtooltip/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating tool tips manually using the ToolTipManager class</title>
		<link>http://blog.flexexamples.com/2007/08/15/creating-tool-tips-manually-using-the-tooltipmanager-class/</link>
		<comments>http://blog.flexexamples.com/2007/08/15/creating-tool-tips-manually-using-the-tooltipmanager-class/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 22:53:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[createToolTip()]]></category>
		<category><![CDATA[destroyToolTip()]]></category>
		<category><![CDATA[ToolTipManager]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/15/creating-tool-tips-manually-using-the-tooltipmanager-class/</guid>
		<description><![CDATA[<p>Here&#8217;s a basic example of creating a text tool tip using the Flex ToolTipManager class and making the tool tip follow the mouse cursor.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ToolTipManager_createToolTip_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/08/15/creating-tool-tips-manually-using-the-tooltipmanager-class/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init()"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.core.IToolTip; import mx.managers.ToolTipManager; import flash.events.MouseEvent; private [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a basic example of creating a text tool tip using the Flex ToolTipManager class and making the tool tip follow the mouse cursor.</p>
<p>Full code after the jump.</p>
<p><span id="more-90"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ToolTipManager_createToolTip_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/15/creating-tool-tips-manually-using-the-tooltipmanager-class/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init()"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.core.IToolTip;
            import mx.managers.ToolTipManager;
            import flash.events.MouseEvent;

            private var tt:IToolTip;

            private function init():void {
                systemManager.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
            }

            private function onMouseMove(evt:MouseEvent):void {
                if (tt) {
                    tt.move(evt.stageX + 10, evt.stageY + 10);
                    evt.updateAfterEvent();
                }
            }

            private function toolTipCreate():void {
                if (tt) {
                    toolTipDestroy();
                }
                tt = ToolTipManager.createToolTip(textInput.text, textInput.x, textInput.y);
            }

            private function toolTipDestroy():void {
                if (tt) {
                    ToolTipManager.destroyToolTip(tt);
                    tt = null;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:TextInput id="textInput" text="Tool tip text..." /&gt;
    &lt;mx:HBox&gt;
        &lt;mx:Button label="create" click="toolTipCreate()" /&gt;
        &lt;mx:Button label="destroy" click="toolTipDestroy()" /&gt;
    &lt;/mx:HBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ToolTipManager_createToolTip_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/ToolTipManager_createToolTip_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating tool tips manually using the ToolTipManager class on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/15/creating-tool-tips-manually-using-the-tooltipmanager-class/',contentID: 'post-90',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'createToolTip(),destroyToolTip(),ToolTipManager',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/15/creating-tool-tips-manually-using-the-tooltipmanager-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

