<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Setting the data tip offset in a Slider control in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 14:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Amit Tamse</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-10203</link>
		<dc:creator>Amit Tamse</dc:creator>
		<pubDate>Sun, 27 Nov 2011 14:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-10203</guid>
		<description>Is there any way to continously show the dataTip of the Slider when the value is increasing??

I tried a lot of things such as dispatching the thumbPress event after every valueCommit event is dispatched but was not able to display it continously.</description>
		<content:encoded><![CDATA[<p>Is there any way to continously show the dataTip of the Slider when the value is increasing??</p>
<p>I tried a lot of things such as dispatching the thumbPress event after every valueCommit event is dispatched but was not able to display it continously.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cesar</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-8374</link>
		<dc:creator>Cesar</dc:creator>
		<pubDate>Wed, 29 Sep 2010 16:23:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-8374</guid>
		<description>Is it possible to control the slider thumb position programatically, when we have two sliders? I tried modifying the HSlider.values property, but the thumbs do not pick up the data change. Maybe I am doing something wrong?</description>
		<content:encoded><![CDATA[<p>Is it possible to control the slider thumb position programatically, when we have two sliders? I tried modifying the HSlider.values property, but the thumbs do not pick up the data change. Maybe I am doing something wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-3208</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Tue, 05 Aug 2008 17:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-3208</guid>
		<description>How about making datatips permanently visible? Have you had any luck trying that? I&#039;d love to see how you do it - &#039;cause I&#039;m at a dead-end.

Thanks!

B</description>
		<content:encoded><![CDATA[<p>How about making datatips permanently visible? Have you had any luck trying that? I&#8217;d love to see how you do it &#8211; &#8217;cause I&#8217;m at a dead-end.</p>
<p>Thanks!</p>
<p>B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-3207</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Fri, 06 Jun 2008 14:10:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-3207</guid>
		<description>Hello,

Sorry, it&#039;s me against. I write the two coponents, but i allways don&#039;t find the solution. If you can help me it will be great.

main.mxml
------------------------------------------------------------------
&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; xmlns:component=&quot;comps.*&quot;&gt;
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.SliderEvent;
        import mx.collections.ArrayCollection;

        var aRs1:Number = 10;
	var aRs2:Number = 40;

	private function init():void {
            slider.value = slider.getStyle(&quot;dataTipOffset&quot;);
        }

        [Bindable]
        public var myAC:ArrayCollection = new ArrayCollection([{Year:2004, Sales:8000, Cost:1300}]);

        public function get Net():Number {
            var a:Number = myAC.getItemAt(0).Sales;
            return ( a - slider.value );
        }

        private function slider_change(evt:SliderEvent):void {
            lbl.text = valDisplay.format(Net);
        }
    ]]&gt;
&lt;/mx:Script&gt;

&lt;mx:NumberFormatter id=&quot;valDisplay&quot;	thousandsSeparatorFrom=&quot;,&quot; precision=&quot;0&quot;/&gt;

&lt;component:AA x=&quot;10&quot; 	y=&quot;20&quot;/&gt;
&lt;component:BB x=&quot;110&quot; 	y=&quot;20&quot;/&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

COMPONENT AA.mxml
------------------------------------------------------------------
&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Canvas xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;400&quot; height=&quot;30&quot;&gt;
	&lt;mx:FormItem label=&quot;dataTipOffset:&quot; direction=&quot;horizontal&quot;&gt;
    	&lt;mx:HSlider id=&quot;slider&quot;
     	   	minimum=&quot;100&quot;
     	   	maximum=&quot;300&quot;
      	  	snapInterval=&quot;100&quot;
       	 	tickInterval=&quot;100&quot;
       	 	liveDragging=&quot;true&quot;
        	dataTipOffset=&quot;{slider.value}&quot;
        	dataTipPrecision=&quot;0&quot;
        	showTrackHighlight=&quot;true&quot;
        	initialize=&quot;init();&quot;
        	change=&quot;slider_change(event);&quot; /&gt;
	&lt;/mx:FormItem&gt;
	&lt;mx:Label text=&quot;{slider.value}&quot; width=&quot;80&quot; /&gt;
&lt;/mx:Canvas&gt;
&lt;/pre&gt;


COMPONENT BB.mxml
------------------------------------------------------------------
&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Canvas xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;80&quot; &gt;
	&lt;mx:Label id=&quot;lbl&quot; text=&quot;$ {valDisplay.format(Net)}&quot; /&gt;
	&lt;mx:Label          text=&quot;{aRs1}&quot; /&gt;
	&lt;mx:Label          text=&quot;{aRs2}&quot; /&gt;
&lt;/mx:Canvas&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Sorry, it&#8217;s me against. I write the two coponents, but i allways don&#8217;t find the solution. If you can help me it will be great.</p>
<p>main.mxml<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:component="comps.*"&gt;
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.SliderEvent;
        import mx.collections.ArrayCollection;

        var aRs1:Number = 10;
	var aRs2:Number = 40;

	private function init():void {
            slider.value = slider.getStyle("dataTipOffset");
        }

        [Bindable]
        public var myAC:ArrayCollection = new ArrayCollection([{Year:2004, Sales:8000, Cost:1300}]);

        public function get Net():Number {
            var a:Number = myAC.getItemAt(0).Sales;
            return ( a - slider.value );
        }

        private function slider_change(evt:SliderEvent):void {
            lbl.text = valDisplay.format(Net);
        }
    ]]&gt;
&lt;/mx:Script&gt;

&lt;mx:NumberFormatter id="valDisplay"	thousandsSeparatorFrom="," precision="0"/&gt;

&lt;component:AA x="10" 	y="20"/&gt;
&lt;component:BB x="110" 	y="20"/&gt;

&lt;/mx:Application&gt;
</pre>
<p>COMPONENT AA.mxml<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="30"&gt;
	&lt;mx:FormItem label="dataTipOffset:" direction="horizontal"&gt;
    	&lt;mx:HSlider id="slider"
     	   	minimum="100"
     	   	maximum="300"
      	  	snapInterval="100"
       	 	tickInterval="100"
       	 	liveDragging="true"
        	dataTipOffset="{slider.value}"
        	dataTipPrecision="0"
        	showTrackHighlight="true"
        	initialize="init();"
        	change="slider_change(event);" /&gt;
	&lt;/mx:FormItem&gt;
	&lt;mx:Label text="{slider.value}" width="80" /&gt;
&lt;/mx:Canvas&gt;
</pre>
<p>COMPONENT BB.mxml<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="80" &gt;
	&lt;mx:Label id="lbl" text="$ {valDisplay.format(Net)}" /&gt;
	&lt;mx:Label          text="{aRs1}" /&gt;
	&lt;mx:Label          text="{aRs2}" /&gt;
&lt;/mx:Canvas&gt;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-3206</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Thu, 05 Jun 2008 12:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-3206</guid>
		<description>Hello Peter,

Looking for the last modified script:
&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot;
				xmlns:component=&quot;comps.*&quot;&gt;
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.SliderEvent;
        import mx.collections.ArrayCollection;

        private function init():void {
            slider.value = slider.getStyle(&quot;dataTipOffset&quot;);
        }

        [Bindable]
        public var myAC:ArrayCollection = new ArrayCollection([{Year:2004, Sales:8000, Cost:1300}]);

        public function get Net():Number {
            var a:Number = myAC.getItemAt(0).Sales;
            var b:Number = slider.value;
            return ( a - slider.value );
        }

        private function slider_change(evt:SliderEvent):void {
            //lbl.text = Net.toString();
            lbl.text = valDisplay.format(Net);
        }
    ]]&gt;
&lt;/mx:Script&gt;

&lt;mx:NumberFormatter id=&quot;valDisplay&quot;	thousandsSeparatorFrom=&quot;,&quot; precision=&quot;0&quot;/&gt;

&lt;mx:FormItem label=&quot;dataTipOffset:&quot; direction=&quot;horizontal&quot;&gt;
    &lt;mx:HSlider id=&quot;slider&quot;
        minimum=&quot;100&quot;
        maximum=&quot;300&quot;
        snapInterval=&quot;100&quot;
        tickInterval=&quot;100&quot;
        liveDragging=&quot;true&quot;
        dataTipOffset=&quot;{slider.value}&quot;
        dataTipPrecision=&quot;0&quot;
        showTrackHighlight=&quot;true&quot;
        initialize=&quot;init();&quot;
        change=&quot;slider_change(event);&quot; /&gt;
    &lt;mx:Label text=&quot;{slider.value}&quot; width=&quot;80&quot; /&gt;
&lt;/mx:FormItem&gt;

&lt;mx:Label id=&quot;lbl&quot; x=&quot;400&quot; text=&quot;$ {valDisplay.format(Net)}&quot; width=&quot;80&quot; /&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

I add xmlns:component=&quot;comps.*&quot; in order to have TWO components. The first one which contain the &quot;formItem&quot; and the second one the &quot;label&quot;. I have passed many time to try, but i don&#039;t found the solution.
Can you help me Please.</description>
		<content:encoded><![CDATA[<p>Hello Peter,</p>
<p>Looking for the last modified script:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
				xmlns:component="comps.*"&gt;
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.SliderEvent;
        import mx.collections.ArrayCollection;

        private function init():void {
            slider.value = slider.getStyle("dataTipOffset");
        }

        [Bindable]
        public var myAC:ArrayCollection = new ArrayCollection([{Year:2004, Sales:8000, Cost:1300}]);

        public function get Net():Number {
            var a:Number = myAC.getItemAt(0).Sales;
            var b:Number = slider.value;
            return ( a - slider.value );
        }

        private function slider_change(evt:SliderEvent):void {
            //lbl.text = Net.toString();
            lbl.text = valDisplay.format(Net);
        }
    ]]&gt;
&lt;/mx:Script&gt;

&lt;mx:NumberFormatter id="valDisplay"	thousandsSeparatorFrom="," precision="0"/&gt;

&lt;mx:FormItem label="dataTipOffset:" direction="horizontal"&gt;
    &lt;mx:HSlider id="slider"
        minimum="100"
        maximum="300"
        snapInterval="100"
        tickInterval="100"
        liveDragging="true"
        dataTipOffset="{slider.value}"
        dataTipPrecision="0"
        showTrackHighlight="true"
        initialize="init();"
        change="slider_change(event);" /&gt;
    &lt;mx:Label text="{slider.value}" width="80" /&gt;
&lt;/mx:FormItem&gt;

&lt;mx:Label id="lbl" x="400" text="$ {valDisplay.format(Net)}" width="80" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>I add xmlns:component=&#8221;comps.*&#8221; in order to have TWO components. The first one which contain the &#8220;formItem&#8221; and the second one the &#8220;label&#8221;. I have passed many time to try, but i don&#8217;t found the solution.<br />
Can you help me Please.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-3202</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Tue, 27 May 2008 09:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-3202</guid>
		<description>Hello Peter

Wow, a million thanks Peter, that&#039;s the fastest response I&#039;ve got so far.</description>
		<content:encoded><![CDATA[<p>Hello Peter</p>
<p>Wow, a million thanks Peter, that&#8217;s the fastest response I&#8217;ve got so far.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-3205</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Tue, 27 May 2008 08:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-3205</guid>
		<description>&lt;a href=&quot;http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13008&quot; rel=&quot;nofollow&quot;&gt;Pierre&lt;/a&gt;,

Change the &lt;mx:NumberFormatter /&gt; to &lt;mx:CurrencyFormatter /&gt;, and then change the &lt;code&gt;slider_change()&lt;/code&gt; method to the following:

&lt;pre class=&quot;code&quot;&gt;
private function slider_change(evt:SliderEvent):void {
    lbl.text = valDisplay.format(Net);
}
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p><a href="http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13008" rel="nofollow">Pierre</a>,</p>
<p>Change the &lt;mx:NumberFormatter /&gt; to &lt;mx:CurrencyFormatter /&gt;, and then change the <code>slider_change()</code> method to the following:</p>
<pre class="code">
private function slider_change(evt:SliderEvent):void {
    lbl.text = valDisplay.format(Net);
}
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-3204</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Tue, 27 May 2008 08:12:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-3204</guid>
		<description>Hello Peter,

Thanks.

Taking the same example, i&#039;m looking for to use mx:formatter.
How to have for the two labels, the formatter : $ ###,### with the precision 0:
I made the coode below but i have no result. Thank for your help

&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot;&gt;
	&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.SliderEvent;
        import mx.collections.ArrayCollection;

        private function init():void {
            slider.value = slider.getStyle(&quot;dataTipOffset&quot;);
        }

        [Bindable]
        public var myAC:ArrayCollection = new ArrayCollection([{Year:2004, Sales:8000, Cost:1300}]);

        public function get Net():Number {
            var a:Number = myAC.getItemAt(0).Sales;
            var b:Number = slider.value;
            return ( a - slider.value );
        }

        private function slider_change(evt:SliderEvent):void {
            lbl.text = Net.toString();
        }
    ]]&gt;
&lt;/mx:Script&gt;

&lt;mx:NumberFormatter id=&quot;valDisplay&quot;	thousandsSeparatorFrom=&quot;,&quot; precision=&quot;0&quot;/&gt;

&lt;mx:FormItem label=&quot;dataTipOffset:&quot; direction=&quot;horizontal&quot;&gt;
    &lt;mx:HSlider id=&quot;slider&quot;
        minimum=&quot;100&quot;
        maximum=&quot;300&quot;
        snapInterval=&quot;100&quot;
        tickInterval=&quot;100&quot;
        liveDragging=&quot;true&quot;
        dataTipOffset=&quot;{slider.value}&quot;
        dataTipPrecision=&quot;0&quot;
        showTrackHighlight=&quot;true&quot;
        initialize=&quot;init();&quot;
        change=&quot;slider_change(event);&quot; /&gt;
    &lt;mx:Label text=&quot;{slider.value}&quot; width=&quot;80&quot; /&gt;
    &lt;mx:Label id=&quot;lbl&quot; text=&quot;$ {valDisplay.format(Net)}&quot; width=&quot;80&quot; /&gt;
&lt;/mx:FormItem&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

Best Regards</description>
		<content:encoded><![CDATA[<p>Hello Peter,</p>
<p>Thanks.</p>
<p>Taking the same example, i&#8217;m looking for to use mx:formatter.<br />
How to have for the two labels, the formatter : $ ###,### with the precision 0:<br />
I made the coode below but i have no result. Thank for your help</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&gt;
	&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.SliderEvent;
        import mx.collections.ArrayCollection;

        private function init():void {
            slider.value = slider.getStyle("dataTipOffset");
        }

        [Bindable]
        public var myAC:ArrayCollection = new ArrayCollection([{Year:2004, Sales:8000, Cost:1300}]);

        public function get Net():Number {
            var a:Number = myAC.getItemAt(0).Sales;
            var b:Number = slider.value;
            return ( a - slider.value );
        }

        private function slider_change(evt:SliderEvent):void {
            lbl.text = Net.toString();
        }
    ]]&gt;
&lt;/mx:Script&gt;

&lt;mx:NumberFormatter id="valDisplay"	thousandsSeparatorFrom="," precision="0"/&gt;

&lt;mx:FormItem label="dataTipOffset:" direction="horizontal"&gt;
    &lt;mx:HSlider id="slider"
        minimum="100"
        maximum="300"
        snapInterval="100"
        tickInterval="100"
        liveDragging="true"
        dataTipOffset="{slider.value}"
        dataTipPrecision="0"
        showTrackHighlight="true"
        initialize="init();"
        change="slider_change(event);" /&gt;
    &lt;mx:Label text="{slider.value}" width="80" /&gt;
    &lt;mx:Label id="lbl" text="$ {valDisplay.format(Net)}" width="80" /&gt;
&lt;/mx:FormItem&gt;

&lt;/mx:Application&gt;
</pre>
<p>Best Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-3203</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Tue, 27 May 2008 06:00:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-3203</guid>
		<description>&lt;a href=&quot;http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-12991&quot; rel=&quot;nofollow&quot;&gt;Pierre&lt;/a&gt;,

Instead of using bindings, I&#039;d probably create a listener for the Slider control&#039;s &lt;code&gt;change&lt;/code&gt; event.

Something like the following:
&lt;pre class=&quot;code&quot;&gt;
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.SliderEvent;

        import mx.collections.ArrayCollection;

        private function init():void {
            slider.value = slider.getStyle(&quot;dataTipOffset&quot;);
        }

        [Bindable]
        public var myAC:ArrayCollection = new ArrayCollection([{Year:2004, Sales:8000, Cost:1300}]);

        public function get Net():Number {
            var a:Number = myAC.getItemAt(0).Sales;
            var b:Number = slider.value;
            return ( a - slider.value );
        }

        &lt;strong style=&quot;color:red;&quot;&gt;private function slider_change(evt:SliderEvent):void {
            lbl.text = Net.toString();
        }&lt;/strong&gt;
    ]]&gt;
&lt;/mx:Script&gt;
...
&lt;mx:FormItem label=&quot;dataTipOffset:&quot; direction=&quot;horizontal&quot;&gt;
    &lt;mx:HSlider id=&quot;slider&quot;
        minimum=&quot;100&quot;
        maximum=&quot;300&quot;
        snapInterval=&quot;100&quot;
        tickInterval=&quot;100&quot;
        liveDragging=&quot;true&quot;
        dataTipOffset=&quot;{slider.value}&quot;
        dataTipPrecision=&quot;0&quot;
        showTrackHighlight=&quot;true&quot;
        initialize=&quot;init();&quot;
        &lt;strong style=&quot;color:red;&quot;&gt;change=&quot;slider_change(event);&quot;&lt;/strong&gt; /&gt;
    &lt;mx:Label text=&quot;{slider.value}&quot; width=&quot;80&quot; /&gt;
    &lt;mx:Label &lt;strong style=&quot;color:red;&quot;&gt;id=&quot;lbl&quot;&lt;/strong&gt; text=&quot;{Net}&quot; width=&quot;80&quot; /&gt;
&lt;/mx:FormItem&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p><a href="http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-12991" rel="nofollow">Pierre</a>,</p>
<p>Instead of using bindings, I&#8217;d probably create a listener for the Slider control&#8217;s <code>change</code> event.</p>
<p>Something like the following:</p>
<pre class="code">
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.SliderEvent;

        import mx.collections.ArrayCollection;

        private function init():void {
            slider.value = slider.getStyle(&quot;dataTipOffset&quot;);
        }

        [Bindable]
        public var myAC:ArrayCollection = new ArrayCollection([{Year:2004, Sales:8000, Cost:1300}]);

        public function get Net():Number {
            var a:Number = myAC.getItemAt(0).Sales;
            var b:Number = slider.value;
            return ( a - slider.value );
        }

        <strong style="color:red;">private function slider_change(evt:SliderEvent):void {
            lbl.text = Net.toString();
        }</strong>
    ]]&gt;
&lt;/mx:Script&gt;
...
&lt;mx:FormItem label=&quot;dataTipOffset:&quot; direction=&quot;horizontal&quot;&gt;
    &lt;mx:HSlider id=&quot;slider&quot;
        minimum=&quot;100&quot;
        maximum=&quot;300&quot;
        snapInterval=&quot;100&quot;
        tickInterval=&quot;100&quot;
        liveDragging=&quot;true&quot;
        dataTipOffset=&quot;{slider.value}&quot;
        dataTipPrecision=&quot;0&quot;
        showTrackHighlight=&quot;true&quot;
        initialize=&quot;init();&quot;
        <strong style="color:red;">change=&quot;slider_change(event);&quot;</strong> /&gt;
    &lt;mx:Label text=&quot;{slider.value}&quot; width=&quot;80&quot; /&gt;
    &lt;mx:Label <strong style="color:red;">id=&quot;lbl&quot;</strong> text=&quot;{Net}&quot; width=&quot;80&quot; /&gt;
&lt;/mx:FormItem&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre</title>
		<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/comment-page-1/#comment-3201</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Mon, 26 May 2008 13:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-3201</guid>
		<description>Hello,

Your example is very interesting. I add a function but i have no result. Can you help me please.

&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[

        	import mx.collections.ArrayCollection;

            private function init():void {
               slider.value = slider.getStyle(&quot;dataTipOffset&quot;);
            }

           [Bindable]
			public var myAC:ArrayCollection = new ArrayCollection([
				{Year:&quot;2004&quot;, Sales:8000, Cost:1300},
			]);

			public function get Net():Number {
				var a:Number =	myAC.getItemAt(0).Sales;
				var b:Number =	slider.value;
				return ( a - slider.value );
				}

        ]]&gt;
    &lt;/mx:Script&gt;


    &lt;mx:Form&gt;
        &lt;mx:FormItem label=&quot;dataTipOffset:&quot; direction=&quot;horizontal&quot;&gt;
            &lt;mx:HSlider id=&quot;slider&quot;
                    minimum=&quot;100&quot;
                    maximum=&quot;300&quot;
                    snapInterval=&quot;100&quot;
                    tickInterval=&quot;100&quot;
                    liveDragging=&quot;true&quot;
                    dataTipOffset=&quot;{slider.value}&quot;
                    dataTipPrecision=&quot;0&quot;
                    showTrackHighlight=&quot;true&quot;
                    initialize=&quot;init();&quot; /&gt;
            &lt;mx:Label text=&quot;{slider.value}&quot; width=&quot;80&quot; /&gt;
            &lt;mx:Label text=&quot;{Net}&quot; width=&quot;80&quot; /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;
&lt;/mx:Application&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Your example is very interesting. I add a function but i have no result. Can you help me please.</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[

        	import mx.collections.ArrayCollection;

            private function init():void {
               slider.value = slider.getStyle("dataTipOffset");
            }

           [Bindable]
			public var myAC:ArrayCollection = new ArrayCollection([
				{Year:"2004", Sales:8000, Cost:1300},
			]);

			public function get Net():Number {
				var a:Number =	myAC.getItemAt(0).Sales;
				var b:Number =	slider.value;
				return ( a - slider.value );
				}

        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Form&gt;
        &lt;mx:FormItem label="dataTipOffset:" direction="horizontal"&gt;
            &lt;mx:HSlider id="slider"
                    minimum="100"
                    maximum="300"
                    snapInterval="100"
                    tickInterval="100"
                    liveDragging="true"
                    dataTipOffset="{slider.value}"
                    dataTipPrecision="0"
                    showTrackHighlight="true"
                    initialize="init();" /&gt;
            &lt;mx:Label text="{slider.value}" width="80" /&gt;
            &lt;mx:Label text="{Net}" width="80" /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;
&lt;/mx:Application&gt;
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

