<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Manish Jethani</title>
	
	<link>http://manishjethani.com</link>
	<description>&lt;mx:Blog source="/dev/random" ...</description>
	<pubDate>Sun, 02 Nov 2008 21:16:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><image><url>http://feeds.feedburner.com/~fc/mannu</url><title># readers</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/mannu" type="application/rss+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><item>
		<title>Using 9-slice skins with SimpleButton objects: Scale the skins, not the object</title>
		<link>http://feeds.feedburner.com/~r/mannu/~3/433053695/</link>
		<comments>http://manishjethani.com/blog/2008/10/27/using-9-slice-skins-with-simplebutton-objects-scale-the-skins-not-the-object/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 00:40:20 +0000</pubDate>
		<dc:creator>Manish Jethani</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[scale9]]></category>

		<category><![CDATA[simplebutton]]></category>

		<category><![CDATA[skinning]]></category>

		<guid isPermaLink="false">http://manishjethani.com/?p=184</guid>
		<description><![CDATA[I&#8217;ve run into this a few times, and I keep forgetting about it each time. Here&#8217;s the problem: I&#8217;m trying to scale a SimpleButton object that uses 9-slice skins, and the 9-slice just won&#8217;t  work.

button = new SimpleButton();

addChild(button);

button.upState = new upSkin();
button.overState = new overSkin();
button.downState = new downSkin();

button.width = getCalculatedWidth();


What am I doing wrong?

It turns [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve run into this a few times, and I keep forgetting about it each time. Here&#8217;s the problem: I&#8217;m trying to scale a <a href="http://livedocs.adobe.com/flex/3/langref/flash/display/SimpleButton.html" title="API Documentation: flash.display.SimpleButton"><code>SimpleButton</code></a> object that uses <a href="http://help.adobe.com/en_US/Fireworks/9.0/help.html?content=frw_styles_st_13.html" title="Using 9-slice scaling">9-slice</a> skins, and the 9-slice just <a href="http://smg.photobucket.com/albums/v102/mannu/?action=view&amp;current=4abec777.png">won&#8217;t</a> <a href="http://smg.photobucket.com/albums/v102/mannu/?action=view&amp;current=0f15e9e7.jpg"> work</a>.</p>

<pre><code>button = new SimpleButton();

addChild(button);

button.upState = new upSkin();
button.overState = new overSkin();
button.downState = new downSkin();

<em>button.width = getCalculatedWidth();</em>
</code></pre>

<p>What am I doing wrong?</p>

<span id="more-184"></span><p>It turns out you have to <strong>scale the skins</strong> directly instead of scaling the button itself.</p>

<pre><code>button = new SimpleButton();

addChild(button);

button.upState = new upSkin();
button.overState = new overSkin();
button.downState = new downSkin();

var calculatedWidth:Number = getCalculatedWidth();

<em>button.upState.width = calculatedWidth;
button.overState.width = calculatedWidth;
button.downState.width = calculatedWidth;</em>
</code></pre>

<p><a href="http://smg.photobucket.com/albums/v102/mannu/?action=view&amp;current=7fad4f80.png">That</a> <a href="http://smg.photobucket.com/albums/v102/mannu/?action=view&amp;current=481ac1f5.jpg">works</a>!</p><img src="http://feeds.feedburner.com/~r/mannu/~4/433053695" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://manishjethani.com/blog/2008/10/27/using-9-slice-skins-with-simplebutton-objects-scale-the-skins-not-the-object/feed/</wfw:commentRss>
		<feedburner:origLink>http://manishjethani.com/blog/2008/10/27/using-9-slice-skins-with-simplebutton-objects-scale-the-skins-not-the-object/</feedburner:origLink></item>
	</channel>
</rss>
