<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Setting the data tip offset in a Slider control in Flex</title>
	<link>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Sat, 06 Sep 2008 17:10:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<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-14496</link>
		<author>Brandon</author>
		<pubDate>Tue, 05 Aug 2008 17:07:59 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-14496</guid>
		<description>How about making datatips permanently visible? Have you had any luck trying that? I'd love to see how you do it - 'cause I'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 - &#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-13264</link>
		<author>Pierre</author>
		<pubDate>Fri, 06 Jun 2008 14:10:14 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13264</guid>
		<description>Hello,

Sorry, it's me against. I write the two coponents, but i allways don't find the solution. If you can help me it will be great.

main.mxml
------------------------------------------------------------------
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:component="comps.*"&#62;
&#60;mx:Script&#62;
    &#60;![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);
        }
    ]]&#62;
&#60;/mx:Script&#62;

&#60;mx:NumberFormatter id="valDisplay"	thousandsSeparatorFrom="," precision="0"/&#62;

&#60;component:AA x="10" 	y="20"/&#62; 
&#60;component:BB x="110" 	y="20"/&#62; 

&#60;/mx:Application&#62;
&lt;/pre&gt;

COMPONENT AA.mxml
------------------------------------------------------------------
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="30"&#62;
	&#60;mx:FormItem label="dataTipOffset:" direction="horizontal"&#62;
    	&#60;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);" /&#62;
	&#60;/mx:FormItem&#62;
	&#60;mx:Label text="{slider.value}" width="80" /&#62;
&#60;/mx:Canvas&#62;
&lt;/pre&gt;


COMPONENT BB.mxml
------------------------------------------------------------------
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="80" &#62;
	&#60;mx:Label id="lbl" text="$ {valDisplay.format(Net)}" /&#62;
	&#60;mx:Label          text="{aRs1}" /&#62;
	&#60;mx:Label          text="{aRs2}" /&#62;
&#60;/mx:Canvas&#62;
&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-13233</link>
		<author>Pierre</author>
		<pubDate>Thu, 05 Jun 2008 12:36:06 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13233</guid>
		<description>Hello Peter,

Looking for the last modified script:
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
				xmlns:component="comps.*"&#62;
&#60;mx:Script&#62;
    &#60;![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);
        }
    ]]&#62;
&#60;/mx:Script&#62;

&#60;mx:NumberFormatter id="valDisplay"	thousandsSeparatorFrom="," precision="0"/&#62;

&#60;mx:FormItem label="dataTipOffset:" direction="horizontal"&#62;
    &#60;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);" /&#62;
    &#60;mx:Label text="{slider.value}" width="80" /&#62;
&#60;/mx:FormItem&#62;

&#60;mx:Label id="lbl" x="400" text="$ {valDisplay.format(Net)}" width="80" /&#62;

&#60;/mx:Application&#62;
&lt;/pre&gt;

I add xmlns:component="comps.*" in order to have TWO components. The first one which contain the "formItem" and the second one the "label". I have passed many time to try, but i don'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-13011</link>
		<author>Pierre</author>
		<pubDate>Tue, 27 May 2008 09:10:08 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13011</guid>
		<description>Hello Peter

Wow, a million thanks Peter, that's the fastest response I'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-13009</link>
		<author>peterd</author>
		<pubDate>Tue, 27 May 2008 08:25:48 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13009</guid>
		<description>&lt;a href="http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13008" rel="nofollow"&gt;Pierre&lt;/a&gt;,

Change the &#60;mx:NumberFormatter /&#62; to &#60;mx:CurrencyFormatter /&#62;, and then change the &lt;code&gt;slider_change()&lt;/code&gt; method to the following:

&lt;pre class="code"&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-13008</link>
		<author>Pierre</author>
		<pubDate>Tue, 27 May 2008 08:12:25 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13008</guid>
		<description>Hello Peter,

Thanks.

Taking the same example, i'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="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&#62;
	&#60;mx:Script&#62;
    &#60;![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();
        }
    ]]&#62;
&#60;/mx:Script&#62;

&#60;mx:NumberFormatter id="valDisplay"	thousandsSeparatorFrom="," precision="0"/&#62;

&#60;mx:FormItem label="dataTipOffset:" direction="horizontal"&#62;
    &#60;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);" /&#62;
    &#60;mx:Label text="{slider.value}" width="80" /&#62;
    &#60;mx:Label id="lbl" text="$ {valDisplay.format(Net)}" width="80" /&#62;
&#60;/mx:FormItem&#62;

&#60;/mx:Application&#62;
&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-13002</link>
		<author>peterd</author>
		<pubDate>Tue, 27 May 2008 06:00:52 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-13002</guid>
		<description>&lt;a href="http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-12991" rel="nofollow"&gt;Pierre&lt;/a&gt;,

Instead of using bindings, I'd probably create a listener for the Slider control's &lt;code&gt;change&lt;/code&gt; event.

Something like the following:
&lt;pre class="code"&gt;
&#60;mx:Script&#62;
    &#60;![CDATA[
        import mx.events.SliderEvent;

        import mx.collections.ArrayCollection;

        private function init():void {
            slider.value = slider.getStyle(&#34;dataTipOffset&#34;);
        }

        [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="color:red;"&gt;private function slider_change(evt:SliderEvent):void {
            lbl.text = Net.toString();
        }&lt;/strong&gt;
    ]]&#62;
&#60;/mx:Script&#62;
...
&#60;mx:FormItem label=&#34;dataTipOffset:&#34; direction=&#34;horizontal&#34;&#62;
    &#60;mx:HSlider id=&#34;slider&#34;
        minimum=&#34;100&#34;
        maximum=&#34;300&#34;
        snapInterval=&#34;100&#34;
        tickInterval=&#34;100&#34;
        liveDragging=&#34;true&#34;
        dataTipOffset=&#34;{slider.value}&#34;
        dataTipPrecision=&#34;0&#34;
        showTrackHighlight=&#34;true&#34;
        initialize=&#34;init();&#34;
        &lt;strong style="color:red;"&gt;change=&#34;slider_change(event);&#34;&lt;/strong&gt; /&#62;
    &#60;mx:Label text=&#34;{slider.value}&#34; width=&#34;80&#34; /&#62;
    &#60;mx:Label &lt;strong style="color:red;"&gt;id=&#34;lbl&#34;&lt;/strong&gt; text=&#34;{Net}&#34; width=&#34;80&#34; /&#62;
&#60;/mx:FormItem&#62;
&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;
&#8230;
&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-12991</link>
		<author>Pierre</author>
		<pubDate>Mon, 26 May 2008 13:50:16 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/#comment-12991</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="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&#62;

    &#60;mx:Script&#62;
        &#60;![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 );
				}

        ]]&#62;
    &#60;/mx:Script&#62;

    
    &#60;mx:Form&#62;
        &#60;mx:FormItem label="dataTipOffset:" direction="horizontal"&#62;
            &#60;mx:HSlider id="slider"
                    minimum="100"
                    maximum="300"
                    snapInterval="100"
                    tickInterval="100"
                    liveDragging="true"
                    dataTipOffset="{slider.value}"
                    dataTipPrecision="0"
                    showTrackHighlight="true"
                    initialize="init();" /&#62;
            &#60;mx:Label text="{slider.value}" width="80" /&#62;
            &#60;mx:Label text="{Net}" width="80" /&#62;
        &#60;/mx:FormItem&#62;
    &#60;/mx:Form&#62;
&#60;/mx:Application&#62;
&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>
