<?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: AS3 scrollRect vs height &amp; getBounds()</title>
	<atom:link href="http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/feed/" rel="self" type="application/rss+xml" />
	<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/</link>
	<description>Navigating the treacherous waters of interactive technology</description>
	<lastBuildDate>Sat, 12 May 2012 08:57:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: almo</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-2588</link>
		<dc:creator>almo</dc:creator>
		<pubDate>Fri, 25 Nov 2011 01:37:21 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-2588</guid>
		<description>One way to fix the problem with the &quot;scrollRect one-frame delay before you can read width/height&quot; is to use scrollRect.width or scrollRect.height instead of width/height. Those values are available right away.</description>
		<content:encoded><![CDATA[<p>One way to fix the problem with the &#8220;scrollRect one-frame delay before you can read width/height&#8221; is to use scrollRect.width or scrollRect.height instead of width/height. Those values are available right away.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to retrieve original movieclip height after applying scrollrect in AS3 &#171; encryptedpixel</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-2580</link>
		<dc:creator>How to retrieve original movieclip height after applying scrollrect in AS3 &#171; encryptedpixel</dc:creator>
		<pubDate>Fri, 19 Aug 2011 07:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-2580</guid>
		<description>[...] http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/  Advertisement  GA_googleAddAttr(&quot;AdOpt&quot;, &quot;1&quot;); GA_googleAddAttr(&quot;Origin&quot;, &quot;other&quot;); GA_googleAddAttr(&quot;theme_bg&quot;, &quot;ffffff&quot;); GA_googleAddAttr(&quot;theme_border&quot;, &quot;dddddd&quot;); GA_googleAddAttr(&quot;theme_text&quot;, &quot;444444&quot;); GA_googleAddAttr(&quot;theme_link&quot;, &quot;ac6c13&quot;); GA_googleAddAttr(&quot;theme_url&quot;, &quot;6ab32e&quot;); GA_googleAddAttr(&quot;LangId&quot;, &quot;1&quot;); GA_googleAddAttr(&quot;Autotag&quot;, &quot;books&quot;); GA_googleAddAttr(&quot;Autotag&quot;, &quot;entertainment&quot;); GA_googleAddAttr(&quot;Autotag&quot;, &quot;technology&quot;); GA_googleFillSlot(&quot;wpcom_below_post&quot;);  Like this:LikeBe the first to like this post. [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/" rel="nofollow">http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/</a>  Advertisement  GA_googleAddAttr(&quot;AdOpt&quot;, &quot;1&quot;); GA_googleAddAttr(&quot;Origin&quot;, &quot;other&quot;); GA_googleAddAttr(&quot;theme_bg&quot;, &quot;ffffff&quot;); GA_googleAddAttr(&quot;theme_border&quot;, &quot;dddddd&quot;); GA_googleAddAttr(&quot;theme_text&quot;, &quot;444444&quot;); GA_googleAddAttr(&quot;theme_link&quot;, &quot;ac6c13&quot;); GA_googleAddAttr(&quot;theme_url&quot;, &quot;6ab32e&quot;); GA_googleAddAttr(&quot;LangId&quot;, &quot;1&quot;); GA_googleAddAttr(&quot;Autotag&quot;, &quot;books&quot;); GA_googleAddAttr(&quot;Autotag&quot;, &quot;entertainment&quot;); GA_googleAddAttr(&quot;Autotag&quot;, &quot;technology&quot;); GA_googleFillSlot(&quot;wpcom_below_post&quot;);  Like this:LikeBe the first to like this post. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Beall</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-2563</link>
		<dc:creator>Aaron Beall</dc:creator>
		<pubDate>Thu, 24 Mar 2011 08:43:46 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-2563</guid>
		<description>Moock&#039;s example is to draw to an arbitrarily large bitmapdata and use getColorBoundsRect. There are a number of problems with that approach (as well as all other examples I could find), but it led me to discover the one workaround that seems to account for everything:
BitmapData.draw() forces an object to be redrawn immediately. It works around all the wonky deferring of changing scrollRect, and it works with parent trees, getBounds, and all other scenarios I could find.
It&#039;s kind of frustrating there isn&#039;t a built in solution, if BitmapData.draw can tell what needs to be redrawn and redraw it immediately, why isn&#039;t there a way for us? Anyway, in the end my redraw method is simply:
package {
 import flash.display.DisplayObject;
 import flash.display.BitmapData;

 public function redrawNow(displayObject:DisplayObject):void {
 var bitmapData:BitmapData = new BitmapData(1, 1);
 bitmapData.draw(displayObject);
 bitmapData.dispose();
 }
}
So now for instance I can:
var oldRect:Rectangle = obj.scrollRect;
obj.scrollRect = null;
redrawNow(obj);
var bounds:Rectangle = obj.getBounds(this);
obj.scrollRect = oldRect;
redrawNow(obj);</description>
		<content:encoded><![CDATA[<p>Moock&#8217;s example is to draw to an arbitrarily large bitmapdata and use getColorBoundsRect. There are a number of problems with that approach (as well as all other examples I could find), but it led me to discover the one workaround that seems to account for everything:<br />
BitmapData.draw() forces an object to be redrawn immediately. It works around all the wonky deferring of changing scrollRect, and it works with parent trees, getBounds, and all other scenarios I could find.<br />
It&#8217;s kind of frustrating there isn&#8217;t a built in solution, if BitmapData.draw can tell what needs to be redrawn and redraw it immediately, why isn&#8217;t there a way for us? Anyway, in the end my redraw method is simply:<br />
package {<br />
 import flash.display.DisplayObject;<br />
 import flash.display.BitmapData;</p>
<p> public function redrawNow(displayObject:DisplayObject):void {<br />
 var bitmapData:BitmapData = new BitmapData(1, 1);<br />
 bitmapData.draw(displayObject);<br />
 bitmapData.dispose();<br />
 }<br />
}<br />
So now for instance I can:<br />
var oldRect:Rectangle = obj.scrollRect;<br />
obj.scrollRect = null;<br />
redrawNow(obj);<br />
var bounds:Rectangle = obj.getBounds(this);<br />
obj.scrollRect = oldRect;<br />
redrawNow(obj);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: azurDePuch</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-158</link>
		<dc:creator>azurDePuch</dc:creator>
		<pubDate>Thu, 09 Jul 2009 18:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-158</guid>
		<description>nice try, but it didn&#039;t work for me

take a look at this

http://www.moock.org/blog/archives/000292.html</description>
		<content:encoded><![CDATA[<p>nice try, but it didn&#8217;t work for me</p>
<p>take a look at this</p>
<p><a href="http://www.moock.org/blog/archives/000292.html" rel="nofollow">http://www.moock.org/blog/archives/000292.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karoshi Ethos &#187; Get Visible Width &#38; Height of DisplayObject (redux)</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-119</link>
		<dc:creator>Karoshi Ethos &#187; Get Visible Width &#38; Height of DisplayObject (redux)</dc:creator>
		<pubDate>Tue, 26 May 2009 18:22:41 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-119</guid>
		<description>[...] You may remember my article on scrollRect and getBounds(). [...]</description>
		<content:encoded><![CDATA[<p>[...] You may remember my article on scrollRect and getBounds(). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Wheeler</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-86</link>
		<dc:creator>Joe Wheeler</dc:creator>
		<pubDate>Tue, 24 Feb 2009 11:35:36 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-86</guid>
		<description>Here&#039;s a fix: &lt;a href=&quot;http://usecake.com/lab/find-the-height-and-width-of-a-sprite-with-a-scrollrect.html&quot; title=&quot;accurately get the width and/or height of scrollRect content&quot; rel=&quot;nofollow&quot;&gt;accurately get the width and height of scrollRect content&lt;/a&gt;. It takes a bit of mucking about with matrixes, but I works consistently, whether  or not the DisplayObject is on the display list; doesn&#039;t require adding/removing from the display list and is unaffected by parent transforms.


Hope this helps someone.
J



</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a fix: <a href="http://usecake.com/lab/find-the-height-and-width-of-a-sprite-with-a-scrollrect.html" title="accurately get the width and/or height of scrollRect content" rel="nofollow">accurately get the width and height of scrollRect content</a>. It takes a bit of mucking about with matrixes, but I works consistently, whether  or not the DisplayObject is on the display list; doesn&#8217;t require adding/removing from the display list and is unaffected by parent transforms.</p>
<p>Hope this helps someone.<br />
J</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hardik Dubal</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-85</link>
		<dc:creator>Hardik Dubal</dc:creator>
		<pubDate>Tue, 24 Feb 2009 05:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-85</guid>
		<description>Thank you... content.transform.pixelBounds.height worked for me while trying to make a scroll bar.</description>
		<content:encoded><![CDATA[<p>Thank you&#8230; content.transform.pixelBounds.height worked for me while trying to make a scroll bar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Find the height and width of a Sprite with a scrollRect &#187; Joe Wheeler &#187; Use Cake</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-84</link>
		<dc:creator>Find the height and width of a Sprite with a scrollRect &#187; Joe Wheeler &#187; Use Cake</dc:creator>
		<pubDate>Tue, 24 Feb 2009 01:19:43 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-84</guid>
		<description>[...] Jon Williams posted an interesting idea, using transform.pixelBounds. Which actually gets most of the way to a solution, but it all goes horribly wrong when the any of the parent objects are scaled and/or rotated. It also finds weird values when the object is off the display list (always x5 the actual value). [...]</description>
		<content:encoded><![CDATA[<p>[...] Jon Williams posted an interesting idea, using transform.pixelBounds. Which actually gets most of the way to a solution, but it all goes horribly wrong when the any of the parent objects are scaled and/or rotated. It also finds weird values when the object is off the display list (always x5 the actual value). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Wheeler</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-83</link>
		<dc:creator>Joe Wheeler</dc:creator>
		<pubDate>Mon, 23 Feb 2009 22:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-83</guid>
		<description>Sorry, I&#039;ve found a bug. The pixelBounds value changes if the parent, or any of the display containers surrounding the clipped DisplayObject are transformed in any way what so ever. So, if you scale the parent clip to 10% your pixelBounds will be 10% of the correct value. Probably the easiest work-around is to temporarily remove the DisplayObject from the display list and divide the pixelBounds values by five. What a palava.</description>
		<content:encoded><![CDATA[<p>Sorry, I&#8217;ve found a bug. The pixelBounds value changes if the parent, or any of the display containers surrounding the clipped DisplayObject are transformed in any way what so ever. So, if you scale the parent clip to 10% your pixelBounds will be 10% of the correct value. Probably the easiest work-around is to temporarily remove the DisplayObject from the display list and divide the pixelBounds values by five. What a palava.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: paulo barcelos</title>
		<link>http://karoshiethos.com/2008/10/22/as3-scrollrect-vs-height-getbounds/comment-page-1/#comment-79</link>
		<dc:creator>paulo barcelos</dc:creator>
		<pubDate>Fri, 13 Feb 2009 20:38:52 +0000</pubDate>
		<guid isPermaLink="false">http://karoshiethos.com/?p=121#comment-79</guid>
		<description>Thanks!
I spent 3 months trying to figure out why content.height would output the correct values... content.transform.pixelBounds.height is the solution!!</description>
		<content:encoded><![CDATA[<p>Thanks!<br />
I spent 3 months trying to figure out why content.height would output the correct values&#8230; content.transform.pixelBounds.height is the solution!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

