<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flash Moments &#187; bugs</title>
	<atom:link href="http://flashmoments.novelastudios.com/tag/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://flashmoments.novelastudios.com</link>
	<description>ActionScript, Flash, and Flex</description>
	<lastBuildDate>Wed, 01 Dec 2010 02:59:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Rasterize a Transformed Vector without Pixelation</title>
		<link>http://flashmoments.novelastudios.com/flex-3/rasterize-a-transformed-vector-without-pixelation/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/flex-3/rasterize-a-transformed-vector-without-pixelation/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 18:16:00 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=17</guid>
		<description><![CDATA[How does one rasterize a transformed vector capturing it&#8217;s new dimensions without pixelation? Note: This follows my previous post Matrix Not Synchronized Challenge: To render a bitmap of a transformed vector display object without pixelation. Specifically, after a mx.controls.Text is transformed, a bitmap snapshot is needed to be taken of the new object including the [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left;margin:0px 0px 0px 0px;"></div><p><span style="color: #000000;"><strong>How does one rasterize a transformed vector capturing it&#8217;s new dimensions without pixelation?</strong></span></p>
<p><strong><em>Note</em></strong>: This follows my previous post <a href="http://flashmoments.novelastudios.com/?p=16#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Matrix Not Synchronized</a></p>
<p><strong><em>Challenge</em></strong>: To render a bitmap of a transformed vector display object without pixelation. Specifically, after a mx.controls.Text is transformed, a bitmap snapshot is needed to be taken of the new object including the dimensions.  I should note that the reason I am needing to get a bitmap snapshot is do to some shaping to the text.</p>
<p><strong><em>Problem</em></strong>: However, doing so results in pixelation or resamples / renders the original dimensions of the transformed Text. It appears that flash.display.BitmapData::draw cannot get the new transformed display. In other words,  when a flash.display.InteractiveObject is scaled on the x axis (or any axis) using transform.matrix, flash.display.BitmapData::draw cannot capture the new dimensions of the display object.</p>
<p><strong><em>Example</em></strong>: <a href="http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAndDimensions.html#">http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAndDimensions.html#</a><br />
When the application creation complete is fired a snapshot is made. Change the matrix width (transform.matrix.a) and then re-render a snapshot / bitmap. Notice it retains the original, non-transformed values. Therefore and considering it is a rastered snapshot, when the snapshot/bitmap is scaled it becomes pixelated. Example version was 1.1.0.0 that should this problem. Version 1.2.0.0 is a workaround for now showing the workaround.</p>
<p><strong><em>Workaround</em></strong>: I give credit to Guy Stables (needs a link) and Alex Harui (http://blogs.adobe.com/aharui).  Essentially, the workaround is as follows:</p>
<ol>
<li><span style="color: #000000;"><span class="Apple-style-span">The InteractiveObject (<em>we&#8217;ll call our target</em>) needs to be placed in a container. <em>In this example mx.controls.Text is placed inside a mx.core.UIComponent. </em></span></span></li>
<li><span style="color: #000000;"><span class="Apple-style-span">The matrix transform is then applied to the target (<em>eg mx.controls.Text</em>)</span></span></li>
<li><span style="color: #000000;"><span class="Apple-style-span">The dimensions of the container (<em>eg the UIComponent that contains the Text/target</em>) are then set to the  target&#8217;s pixelBounds dimensions.</span></span></li>
<li><span style="color: #000000;"><span class="Apple-style-span"> Finally, take the snapshot bitmap of the container (<em>the UIComponent</em>).</span></span></li>
</ol>
<p><span style="color: #000000;">For a demonstration see the latest version 1.2.0.0 of the example.</span></p>
<p><strong><em>More Information:</em></strong><br />
Also found at <a href="http://forums.adobe.com/thread/521432">http://forums.adobe.com/thread/521432</a></p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=17&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/flex-3/rasterize-a-transformed-vector-without-pixelation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matrix Not Synchronized</title>
		<link>http://flashmoments.novelastudios.com/graphics/matrix-not-synchronized/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/graphics/matrix-not-synchronized/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 23:37:00 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[bugs]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=16</guid>
		<description><![CDATA[I&#8217;m short on time right now and just want to post this Basically, matrix transforms do not update dimensions, rotations, and coordinates of UIComponents / InteractiveObjects. Take a look at http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAdjustments.html Adjust the width and notice that when you switch over to the Pixel Tab the width never updates. Don&#8217;t believe me, then do a [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left;margin:0px 0px 0px 0px;"></div><div><span style="color: #000000;"><em>I&#8217;m short on time right now and just want to post this</em></span></div>
<div><span style="color: #000000;">Basically, matrix transforms do not update dimensions, rotations, and coordinates of UIComponents / InteractiveObjects.</span></div>
<div><span style="color: #000000;">Take a look at <a href="http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAdjustments.html">http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAdjustments.html</a></span></div>
<div><span style="color: #000000;">Adjust the width and notice that when you switch over to the Pixel Tab the width never updates.</span></div>
<div><span style="color: #000000;">Don&#8217;t believe me, then do a demo yourself.</span></div>
<p><span style="color: #000000;">Create a UIComponent transform the matrix&#8217;s a value and then inspect the width. Notice that there is no change</span></p>
<p><span style="color: #000000;"><span style="color: #000000;"><strong><em>Note: With UIComponents you can change the explicitWidth when the transform takes place to perform a workaround. However, that&#8217;s not the point.</em></strong></span></span></p>
<p><span style="color: #000000;">@Adobe Include event dispatching for matrix transforms!</span></p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=16&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/graphics/matrix-not-synchronized/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serialize/Clone Objects (Bug with Required Constructor Params)</title>
		<link>http://flashmoments.novelastudios.com/actionscript/serializeclone-objects-bug-with-required-constructor-params/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/actionscript/serializeclone-objects-bug-with-required-constructor-params/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 19:12:00 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[discussion wanted]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=11</guid>
		<description><![CDATA[My opinion is that the following is a big bug. When serializing/cloning an object that has required constructor parameters, you receive an error telling you the arguments are incorrect. Note: the following is just an example using a &#8220;native&#8221; flash class. Really, you should never have to serialize or clone an Event, so please just [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left;margin:0px 0px 0px 0px;"></div><p><span style="font-family: arial;"><span style="color: #000000;">My opinion is that the following is a big bug.<br style="color: #eeeeee;" /><br style="color: #eeeeee;" /> When serializing/cloning an object that has required constructor parameters, you receive an error telling you the arguments are incorrect. </span> <em style="color: black;">Note: the following is just an example using a &#8220;native&#8221; flash class</em>.<em style="color: black;"> Really, you should never have to serialize or clone an Event, so please just see it as an example class as the type of class isn&#8217;t the point.</em></span></p>
<pre lang="Actionscript" colla="+">
import flash.net.registerClassAlias;
import flash.events.Event;
import mx.utils.ObjectUtil;

flash.net.registerClassAlias("flash.events.Event",Event);
var event:Event = new Event(Event.CHANGE);
var eventClone:* = ObjectUtil.copy(event);
trace(eventClone is Event)
</pre>
<p>RESULT<br />
<span style="font-family: courier new;">ArgumentError: Error #1063: Argument count mismatch on flash.events::Event(). Expected 1, got 0.</span><br />
<span style="font-family: courier new;"> at flash.utils::ByteArray/readObject()</span><br />
<span style="font-family: courier new;"> at mx.utils::ObjectUtil$/copy()</span><br />
<span style="font-family: courier new;"> at Untitled_fla::MainTimeline/frame1()</span><br />
<span style="font-size: 85%;"></span></span><br />
<br/><br />
<span style="color: #000000;">As noted by <a style="color: #eeeeee;" href="http://www.ultrashock.com/forums/734607-post12.html">Nutrox</a>, &#8220;All constructor parameters need a default value. You can&#8217;t pass values directly to an object&#8217;s constructor when it is restored from serialised data because Flash creates an instance of the object automatically before calling the object&#8217;s readExternal() method.&#8221;</span></p>
<div><span style="color: #000000;"><span style="font-family: arial;"> </span></span></div>
<p><span style="font-family: arial;"><span style="color: #000000;"><br style="color: #eeeeee;" /><br style="color: #eeeeee;" /><strong>What are your thoughts?</strong> I&#8217;m interested in striking a conversation about this.</span><br />
</span><br />
<br/><br />
<br/></p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=11&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/actionscript/serializeclone-objects-bug-with-required-constructor-params/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DisplayObject.scrollRect dimension reporting workaround</title>
		<link>http://flashmoments.novelastudios.com/actionscript/displayobject-scrollrect-dimension-reporting-workaround/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/actionscript/displayobject-scrollrect-dimension-reporting-workaround/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 21:28:00 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[flash player]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=6</guid>
		<description><![CDATA[I came across a bug where when you set the scrollRect of a DisplayObject and get a dimension, within the first few mil/nano-seconds it reports the correct width and height. However, after that the reported width and height is the scrollRect&#8216;s width and height. This to me is a bug considering you can not request [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left;margin:0px 0px 0px 0px;"></div><p>I came across a bug where when you set the <span style="color: #3366ff;">scrollRect</span> of a <span style="color: #3366ff;">DisplayObject</span> and get a dimension, within the first few mil/nano-seconds it reports the correct width and height. However, after that the reported width and height is the <span style="color: #3366ff;">scrollRect</span>&#8216;s width and height. This to me is a <span style="font-style: italic;">bug</span> considering you can not request the object to tell you it&#8217;s full dimensions any longer.</p>
<p>Take a look at <a href="http://www.kirupa.com/forum/archive/index.php/t-256884.html" target="_blank">http://www.kirupa.com/forum/archive/index.php/t-256884.html</a> and here is the <strong>solution</strong> <em><strong><a href="http://usecake.com/lab/find-the-height-and-width-of-a-sprite-with-a-scrollrect.html" target="_blank">http://usecake.com/lab/find-the-height-and-width-of-a-sprite-with-a-scrollrect.html</a></strong></em></p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=6&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/actionscript/displayobject-scrollrect-dimension-reporting-workaround/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

