<?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: Changing a slider control&#8217;s thumb skin</title>
	<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Wed, 08 Oct 2008 10:56:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: JOse</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-12808</link>
		<author>JOse</author>
		<pubDate>Tue, 20 May 2008 20:19:42 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-12808</guid>
		<description>Hi Peter,

This is a big help. Thanks. You have been a great help. I´m from Uruguay and I needed use sliders from make a zoom in a column chart.

Do you have any ideas?

Thanks</description>
		<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>This is a big help. Thanks. You have been a great help. I´m from Uruguay and I needed use sliders from make a zoom in a column chart.</p>
<p>Do you have any ideas?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-7417</link>
		<author>peterd</author>
		<pubDate>Sat, 08 Mar 2008 18:18:09 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-7417</guid>
		<description>Anand,

Something like Doug McCune's &lt;a href="http://dougmccune.com/blog/2007/01/21/draggable-slider-component-for-flex/" rel="nofollow"&gt;"&lt;u&gt;Draggable Slider Component for Flex&lt;/u&gt;"&lt;/a&gt;?

Peter</description>
		<content:encoded><![CDATA[<p>Anand,</p>
<p>Something like Doug McCune&#8217;s <a href="http://dougmccune.com/blog/2007/01/21/draggable-slider-component-for-flex/" rel="nofollow">&#8220;<u>Draggable Slider Component for Flex</u>&#8220;</a>?</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anand Jha</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-7411</link>
		<author>Anand Jha</author>
		<pubDate>Sat, 08 Mar 2008 10:36:04 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-7411</guid>
		<description>Hi Peter

Please help me in achieving the following:

"To drag the region between the thumbs, if the HSlider has two thumbs".

Do we have any option in HSlider?

   Or 

Do i need to rewrite HSlider which will implement Slider?


Thanx in advance

~Anand</description>
		<content:encoded><![CDATA[<p>Hi Peter</p>
<p>Please help me in achieving the following:</p>
<p>&#8220;To drag the region between the thumbs, if the HSlider has two thumbs&#8221;.</p>
<p>Do we have any option in HSlider?</p>
<p>   Or </p>
<p>Do i need to rewrite HSlider which will implement Slider?</p>
<p>Thanx in advance</p>
<p>~Anand</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeffs</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-6273</link>
		<author>jeffs</author>
		<pubDate>Tue, 22 Jan 2008 20:02:10 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-6273</guid>
		<description>Is it possible to use a UIComponent as a skin for say the thumbUpSkin. How would I go about assigning that to the hSlider?

</description>
		<content:encoded><![CDATA[<p>Is it possible to use a UIComponent as a skin for say the thumbUpSkin. How would I go about assigning that to the hSlider?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-5909</link>
		<author>peterd</author>
		<pubDate>Tue, 08 Jan 2008 23:40:44 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-5909</guid>
		<description>john,

Something like the following should work:
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;!-- main.mxml --&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&#62;

    &#60;mx:Script&#62;
        &#60;![CDATA[
            [Bindable]
            [Embed(source="add.png")]
            private var icon1:Class;

            [Bindable]
            [Embed(source="delete.png")]
            private var icon2:Class;

            private function style1():void {
                /* Short */
                StyleManager.getStyleDeclaration("HSlider").setStyle("thumbSkin", icon1);
            }

            private function style2():void {
                /* Long */
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration("HSlider");
                cssObj.setStyle("thumbSkin", icon2);
            }
        ]]&#62;
    &#60;/mx:Script&#62;

    &#60;mx:Style&#62;
        HSlider {
            thumbSkin: Embed(source="add.png");
            dataTipPlacement: right;
            dataTipOffset: 0;
        }
    &#60;/mx:Style&#62;

    &#60;mx:ApplicationControlBar dock="true"&#62;
        &#60;mx:Button label="icon 1" icon="{icon1}" click="style1();" /&#62;
        &#60;mx:Button label="icon 2" icon="{icon2}" click="style2();" /&#62;
    &#60;/mx:ApplicationControlBar&#62;

    &#60;mx:HSlider id="slider" sliderThumbClass="BulletThumbClass" /&#62;

&#60;/mx:Application&#62;
&lt;/pre&gt;

&lt;pre class="code"&gt;
/** BulletThumbClass.as */
package {
    import mx.controls.sliderClasses.SliderThumb;

    public class BulletThumbClass extends SliderThumb {
        public function BulletThumbClass() {
            super();
        }

        override protected function measure():void {
            super.measure();
            measuredHeight = minHeight;
            measuredWidth = minWidth;
        }
    }
}
&lt;/pre&gt;

Hope that helps,
Peter

PS: Thanks to Ronzoni's comments above for the &lt;code&gt;measure()&lt;/code&gt; trick so you don't have to hard-code icon dimensions.</description>
		<content:encoded><![CDATA[<p>john,</p>
<p>Something like the following should work:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- main.mxml --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            [Bindable]
            [Embed(source="add.png")]
            private var icon1:Class;

            [Bindable]
            [Embed(source="delete.png")]
            private var icon2:Class;

            private function style1():void {
                /* Short */
                StyleManager.getStyleDeclaration("HSlider").setStyle("thumbSkin", icon1);
            }

            private function style2():void {
                /* Long */
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration("HSlider");
                cssObj.setStyle("thumbSkin", icon2);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Style&gt;
        HSlider {
            thumbSkin: Embed(source="add.png");
            dataTipPlacement: right;
            dataTipOffset: 0;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="icon 1" icon="{icon1}" click="style1();" /&gt;
        &lt;mx:Button label="icon 2" icon="{icon2}" click="style2();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HSlider id="slider" sliderThumbClass="BulletThumbClass" /&gt;

&lt;/mx:Application&gt;
</pre>
<pre class="code">
/** BulletThumbClass.as */
package {
    import mx.controls.sliderClasses.SliderThumb;

    public class BulletThumbClass extends SliderThumb {
        public function BulletThumbClass() {
            super();
        }

        override protected function measure():void {
            super.measure();
            measuredHeight = minHeight;
            measuredWidth = minWidth;
        }
    }
}
</pre>
<p>Hope that helps,<br />
Peter</p>
<p>PS: Thanks to Ronzoni&#8217;s comments above for the <code>measure()</code> trick so you don&#8217;t have to hard-code icon dimensions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-5445</link>
		<author>john</author>
		<pubDate>Mon, 24 Dec 2007 17:07:40 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-5445</guid>
		<description>Hi,
Thanks for your article.
I have one question:
like below:
&lt;pre class="code"&gt;
HSlider {
            thumbSkin: Embed(source="assets/bug.png");
            dataTipPlacement: right;
            dataTipOffset: 0;
        }
&lt;/pre&gt;

I wan't dynamic change the thumbSkin by coding.How can I code?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for your article.<br />
I have one question:<br />
like below:</p>
<pre class="code">
HSlider {
            thumbSkin: Embed(source="assets/bug.png");
            dataTipPlacement: right;
            dataTipOffset: 0;
        }
</pre>
<p>I wan&#8217;t dynamic change the thumbSkin by coding.How can I code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jack</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-4816</link>
		<author>jack</author>
		<pubDate>Thu, 06 Dec 2007 14:33:17 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-4816</guid>
		<description>Hi,
This is a big help. I tried it and have one serious problem. I'm emulating a scrollbar, but want the control of hslider. So the thumb is a rather large shape, 240 pixels. I'm using a skin for the track as well, and for some reason it's leaving big gaps in the track when I use the thumbclass setting such a big width. 

Do you have any ideas?

Thanks</description>
		<content:encoded><![CDATA[<p>Hi,<br />
This is a big help. I tried it and have one serious problem. I&#8217;m emulating a scrollbar, but want the control of hslider. So the thumb is a rather large shape, 240 pixels. I&#8217;m using a skin for the track as well, and for some reason it&#8217;s leaving big gaps in the track when I use the thumbclass setting such a big width. </p>
<p>Do you have any ideas?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronzoni</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-4658</link>
		<author>Ronzoni</author>
		<pubDate>Fri, 30 Nov 2007 22:12:26 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-4658</guid>
		<description>I have two questions:

1) How can I make my thumb not overlap the ends of the track?
I haven't even attempted this yet, too busy with other bugs, but it seems like it's something that should be fairly desirable.

2) I would like the measuredHeight of my slider to be only the track height. I can't seem to access the track though in anyway..I've been trying very hard..</description>
		<content:encoded><![CDATA[<p>I have two questions:</p>
<p>1) How can I make my thumb not overlap the ends of the track?<br />
I haven&#8217;t even attempted this yet, too busy with other bugs, but it seems like it&#8217;s something that should be fairly desirable.</p>
<p>2) I would like the measuredHeight of my slider to be only the track height. I can&#8217;t seem to access the track though in anyway..I&#8217;ve been trying very hard..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronzoni</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-4649</link>
		<author>Ronzoni</author>
		<pubDate>Fri, 30 Nov 2007 04:42:48 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-4649</guid>
		<description>I needed to change the thumbSkin with each thumb potentially different sizes.
To prevent it from scaling I made this class:

&lt;pre class="code"&gt;
package player.gui.slider {
	import mx.controls.sliderClasses.SliderThumb;

	public class MySliderThumb extends SliderThumb {
		public function MySliderThumb() {
			super();
		}
		
		override protected function measure():void {
			super.measure();
			measuredHeight = minHeight;
			measuredWidth = minWidth;
		}
	}
}
&lt;/pre&gt;


Not sure if that's potentially problematic, or if there is any easier way to do that..

Anyone know how I can make my thumb not overlap over the ends of the track (and still report the correct value)?</description>
		<content:encoded><![CDATA[<p>I needed to change the thumbSkin with each thumb potentially different sizes.<br />
To prevent it from scaling I made this class:</p>
<pre class="code">
package player.gui.slider {
	import mx.controls.sliderClasses.SliderThumb;

	public class MySliderThumb extends SliderThumb {
		public function MySliderThumb() {
			super();
		}

		override protected function measure():void {
			super.measure();
			measuredHeight = minHeight;
			measuredWidth = minWidth;
		}
	}
}
</pre>
<p>Not sure if that&#8217;s potentially problematic, or if there is any easier way to do that..</p>
<p>Anyone know how I can make my thumb not overlap over the ends of the track (and still report the correct value)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon</title>
		<link>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-2708</link>
		<author>Leon</author>
		<pubDate>Fri, 21 Sep 2007 05:18:51 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/12/changing-a-slider-controls-thumb-skin/#comment-2708</guid>
		<description>Great article,

I think i have found why flex builder 2 cannot display the custom skin correctly.

It seems that we should define the following attributes in flex builder 2

&lt;pre class="code"&gt;
thumbUpSkin:Embed(source="assets/bug.png");
thumbOverSkin:Embed(source="assets/bug.png");
thumbDownSkin:Embed(source="assets/bug.png");
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Great article,</p>
<p>I think i have found why flex builder 2 cannot display the custom skin correctly.</p>
<p>It seems that we should define the following attributes in flex builder 2</p>
<pre class="code">
thumbUpSkin:Embed(source="assets/bug.png");
thumbOverSkin:Embed(source="assets/bug.png");
thumbDownSkin:Embed(source="assets/bug.png");
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
