<?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: Rotating images using the Matrix class</title>
	<atom:link href="http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sat, 11 Feb 2012 11:51:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: vargazso</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-10024</link>
		<dc:creator>vargazso</dc:creator>
		<pubDate>Tue, 04 Oct 2011 19:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-10024</guid>
		<description>Hi, I&#039;m using the above code to rotate and zoom images (SWF images). Currently I&#039;m facing with a problem, where some of the SWF graphics are rotating and zooming perfectly, but there are some image, where this is not working. Graphics are jumping out of screen without controll. The only difference between the good and bad swf objects is the filetype. 7.0 is good others are not so :o( . Tried to convert objects to 7.0 but this is not working also. Have You ever seen this type of problem? Where can I find any solution for it? Any suggestion, what could be wrong? Many thanks in advance, Zsolt</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m using the above code to rotate and zoom images (SWF images). Currently I&#8217;m facing with a problem, where some of the SWF graphics are rotating and zooming perfectly, but there are some image, where this is not working. Graphics are jumping out of screen without controll. The only difference between the good and bad swf objects is the filetype. 7.0 is good others are not so :o( . Tried to convert objects to 7.0 but this is not working also. Have You ever seen this type of problem? Where can I find any solution for it? Any suggestion, what could be wrong? Many thanks in advance, Zsolt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveen</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-8640</link>
		<dc:creator>Praveen</dc:creator>
		<pubDate>Thu, 09 Dec 2010 10:07:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-8640</guid>
		<description>How do i set the duration for the rotation of a matrix object.
I cant seem to find someMatrix.rotate.duration or someMatrix.duration...</description>
		<content:encoded><![CDATA[<p>How do i set the duration for the rotation of a matrix object.<br />
I cant seem to find someMatrix.rotate.duration or someMatrix.duration&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Circass</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-8213</link>
		<dc:creator>Circass</dc:creator>
		<pubDate>Wed, 11 Aug 2010 05:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-8213</guid>
		<description>Hello,
i am trying to rotate my image which is a child of my view panel. 
I wrote something like that :

				var rotate:mx.effects.Rotate = new mx.effects.Rotate();
				//var iTmp:Image = new Image();
				//iTmp = viewerPanel.getChildAt(0) as Image;
				rotate.target= viewerPanel.getChildAt(0);
				rotate.angleFrom=viewerPanel.getChildAt(0).rotation;
				rotate.angleTo=viewerPanel.getChildAt(0).rotation - 90;
				rotate.duration=1000;
				rotate.originX=viewerPanel.getChildAt(0).width/2;
				rotate.originY=viewerPanel.getChildAt(0).height/2; 
				rotate.play();

it rotates the panel from top left.

then i wrote something like that :
				var iTmp:Image = new Image();
				iTmp = viewerPanel.getChildAt(0) as Image;
				var q:Number  = 90 * Math.PI / 180 // 30 degrees in radians
				var m:Matrix = new Matrix();
				var centerX:Number = iTmp.width / 2;
				var centerY:Number = iTmp.height /2;
				m.translate(-1 * centerX, -1 * centerY);
				m.rotate(q);
				viewerPanel.removeChildAt(0);
				viewerPanel.addChild(iTmp);
and this made the same thing. 

So How can i rotate an image which is added to a panel as a child ? 
Thank you.</description>
		<content:encoded><![CDATA[<p>Hello,<br />
i am trying to rotate my image which is a child of my view panel.<br />
I wrote something like that :</p>
<p>				var rotate:mx.effects.Rotate = new mx.effects.Rotate();<br />
				//var iTmp:Image = new Image();<br />
				//iTmp = viewerPanel.getChildAt(0) as Image;<br />
				rotate.target= viewerPanel.getChildAt(0);<br />
				rotate.angleFrom=viewerPanel.getChildAt(0).rotation;<br />
				rotate.angleTo=viewerPanel.getChildAt(0).rotation &#8211; 90;<br />
				rotate.duration=1000;<br />
				rotate.originX=viewerPanel.getChildAt(0).width/2;<br />
				rotate.originY=viewerPanel.getChildAt(0).height/2;<br />
				rotate.play();</p>
<p>it rotates the panel from top left.</p>
<p>then i wrote something like that :<br />
				var iTmp:Image = new Image();<br />
				iTmp = viewerPanel.getChildAt(0) as Image;<br />
				var q:Number  = 90 * Math.PI / 180 // 30 degrees in radians<br />
				var m:Matrix = new Matrix();<br />
				var centerX:Number = iTmp.width / 2;<br />
				var centerY:Number = iTmp.height /2;<br />
				m.translate(-1 * centerX, -1 * centerY);<br />
				m.rotate(q);<br />
				viewerPanel.removeChildAt(0);<br />
				viewerPanel.addChild(iTmp);<br />
and this made the same thing. </p>
<p>So How can i rotate an image which is added to a panel as a child ?<br />
Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mihai</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-6834</link>
		<dc:creator>mihai</dc:creator>
		<pubDate>Sat, 23 Jan 2010 15:17:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-6834</guid>
		<description>And how can I scale Image from center after I rotated it?</description>
		<content:encoded><![CDATA[<p>And how can I scale Image from center after I rotated it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-6634</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Sat, 19 Dec 2009 00:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-6634</guid>
		<description>Here is the code you need to rotate the item when it is not at the origin. The inverted matrix is to get to the local coordinates of the item, the offsets are to rotate around the middle, and then the items initial transform is concatenated to get back to the global coordinates. I wasn&#039;t totally brushed up on my linear algebra and it sounds like this can save everyone some time.

The radians variable is the change in rotation to apply.

&lt;pre lang=&quot;actionscript3&quot;&gt;
var offsetWidth:Number = item.width / 2;
var offsetHeight:Number = item.height / 2;
      
var invertedMatrix:Matrix = item.transform.matrix;
invertedMatrix.invert();
      
var matrix:Matrix = item.transform.matrix;
matrix.concat(invertedMatrix);
matrix.translate(-offsetWidth, -offsetHeight);
matrix.rotate(radians);
matrix.translate(offsetWidth, offsetHeight);
matrix.concat(item.transform.matrix);

item.transform.matrix = matrix;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Here is the code you need to rotate the item when it is not at the origin. The inverted matrix is to get to the local coordinates of the item, the offsets are to rotate around the middle, and then the items initial transform is concatenated to get back to the global coordinates. I wasn&#8217;t totally brushed up on my linear algebra and it sounds like this can save everyone some time.</p>
<p>The radians variable is the change in rotation to apply.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> offsetWidth<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = item<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> offsetHeight<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = item<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span> <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> invertedMatrix<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Matrix</span> = item<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">;</span>
invertedMatrix<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">invert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Matrix</span> = item<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">concat</span><span style="color: #000000;">&#40;</span>invertedMatrix<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">translate</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">-</span>offsetWidth<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000066; font-weight: bold;">-</span>offsetHeight<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotate</span><span style="color: #000000;">&#40;</span>radians<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">translate</span><span style="color: #000000;">&#40;</span>offsetWidth<span style="color: #000066; font-weight: bold;">,</span> offsetHeight<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">concat</span><span style="color: #000000;">&#40;</span>item<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">matrix</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
item<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">matrix</span> = <span style="color: #004993;">matrix</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: sundarapandian</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-6442</link>
		<dc:creator>sundarapandian</dc:creator>
		<pubDate>Tue, 24 Nov 2009 08:58:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-6442</guid>
		<description>I too have this issue .. have u got solution for this?.. if any body has solution for this please share with me..</description>
		<content:encoded><![CDATA[<p>I too have this issue .. have u got solution for this?.. if any body has solution for this please share with me..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-6314</link>
		<dc:creator>Andrea</dc:creator>
		<pubDate>Tue, 10 Nov 2009 13:24:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-6314</guid>
		<description>Many of us are from non-english-speaking countries (and I&#039;m not even sure what last sentence is correct...). Anyway... the thing is, nowadays, English is the unviversal language, and web try to adjust to it as good as we can, but it&#039;s not easy, specially when the conversation is about technologies. Not my case, but there are a lot of fully qualified Flex developer in India, for example.
I don&#039;t think that&#039;s something to be sorry for... good grammar or bad grammar, the important thing is to give something back to the community that always helps us.</description>
		<content:encoded><![CDATA[<p>Many of us are from non-english-speaking countries (and I&#8217;m not even sure what last sentence is correct&#8230;). Anyway&#8230; the thing is, nowadays, English is the unviversal language, and web try to adjust to it as good as we can, but it&#8217;s not easy, specially when the conversation is about technologies. Not my case, but there are a lot of fully qualified Flex developer in India, for example.<br />
I don&#8217;t think that&#8217;s something to be sorry for&#8230; good grammar or bad grammar, the important thing is to give something back to the community that always helps us.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: susrut316</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-6145</link>
		<dc:creator>susrut316</dc:creator>
		<pubDate>Wed, 28 Oct 2009 17:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-6145</guid>
		<description>I have created a fully functional transform tool or object handler in as3 with the help of the matrix transform. Have a look http://talkxe.com/?p=63</description>
		<content:encoded><![CDATA[<p>I have created a fully functional transform tool or object handler in as3 with the help of the matrix transform. Have a look <a href="http://talkxe.com/?p=63" rel="nofollow">http://talkxe.com/?p=63</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-1082</link>
		<dc:creator>Anton</dc:creator>
		<pubDate>Sat, 13 Jun 2009 21:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-1082</guid>
		<description>Aren&#039;t there any developers out there who know how to spell and use good grammar?  What is with you people?</description>
		<content:encoded><![CDATA[<p>Aren&#8217;t there any developers out there who know how to spell and use good grammar?  What is with you people?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RazFlex</title>
		<link>http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/comment-page-1/#comment-1084</link>
		<dc:creator>RazFlex</dc:creator>
		<pubDate>Tue, 09 Jun 2009 13:17:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/#comment-1084</guid>
		<description>What if y want a Y ax rotation ?
What the matrix will be ?
Regards</description>
		<content:encoded><![CDATA[<p>What if y want a Y ax rotation ?<br />
What the matrix will be ?<br />
Regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>

