<?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: Loosing children interactivity after setting perspectiveProjection</title>
	<atom:link href="http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/feed/" rel="self" type="application/rss+xml" />
	<link>http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/</link>
	<description></description>
	<lastBuildDate>Fri, 20 Aug 2010 18:04:48 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: FlashPlayer10 3D blockiert MouseEvents?! - Flashforum</title>
		<link>http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/comment-page-1/#comment-29934</link>
		<dc:creator>FlashPlayer10 3D blockiert MouseEvents?! - Flashforum</dc:creator>
		<pubDate>Mon, 07 Jun 2010 13:32:15 +0000</pubDate>
		<guid isPermaLink="false">http://franto.com/?p=1133#comment-29934</guid>
		<description>[...] Hattest Du den schon gefunden, da steht zumindest ein Workaround drin: Loosing children interactivity after setting perspectiveProjection &#124; franto.com [...]</description>
		<content:encoded><![CDATA[<p>[...] Hattest Du den schon gefunden, da steht zumindest ein Workaround drin: Loosing children interactivity after setting perspectiveProjection | franto.com [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uberVU - social comments</title>
		<link>http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/comment-page-1/#comment-20464</link>
		<dc:creator>uberVU - social comments</dc:creator>
		<pubDate>Wed, 03 Feb 2010 15:02:59 +0000</pubDate>
		<guid isPermaLink="false">http://franto.com/?p=1133#comment-20464</guid>
		<description>&lt;strong&gt;Social comments and analytics for this post...&lt;/strong&gt;

This post was mentioned on Twitter by franto: http://bit.ly/6mLd2r Loosing children interactivity after setting perspectiveProjection #help...</description>
		<content:encoded><![CDATA[<p><strong>Social comments and analytics for this post&#8230;</strong></p>
<p>This post was mentioned on Twitter by franto: <a href="http://bit.ly/6mLd2r" rel="nofollow">http://bit.ly/6mLd2r</a> Loosing children interactivity after setting perspectiveProjection #help&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/comment-page-1/#comment-19863</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 26 Jan 2010 06:12:53 +0000</pubDate>
		<guid isPermaLink="false">http://franto.com/?p=1133#comment-19863</guid>
		<description>Barbara, thank you for your help. It works :)

But i&#039;m curious, if this is just hack or this is how it should work, because it&#039;s not very intuitive :)</description>
		<content:encoded><![CDATA[<p>Barbara, thank you for your help. It works <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But i&#8217;m curious, if this is just hack or this is how it should work, because it&#8217;s not very intuitive <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barbara Kaskosz</title>
		<link>http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/comment-page-1/#comment-19805</link>
		<dc:creator>Barbara Kaskosz</dc:creator>
		<pubDate>Mon, 25 Jan 2010 18:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://franto.com/?p=1133#comment-19805</guid>
		<description>Hi Franto,
The answer to your question is to create a 2D container for your interactive object and to assign a custom PerspectiveProjection to the container and not to the object itself. Below is the code in a file PPTest.as that I assigned as the Document Class to a fla file (with 550 by 400 stage). Everything works fine.
/*
ActionScript 3 Tips by Barbara Kaskosz.

www.flashandmath.com

Last modified: January 25, 2010. 

*/


package {
	
	 import flash.display.Sprite;
  
     import flash.events.MouseEvent;
   
     import flash.geom.PerspectiveProjection;
	 
	 import flash.geom.Point;
	
	 
	 
	
   public class PPTest extends Sprite {
		  
	  private var container:Sprite;
	  
	  private var square:Sprite;
	  
	  private var pp:PerspectiveProjection;
		
		
	  public function PPTest(){
		  

			container=new Sprite();
		
			this.addChild(container);
			
			container.x=400;
			
			container.y=60;
			
			square=new Sprite();
		
			container.addChild(square);
			
			square.x=50;
			
			square.y=50;
			
			drawSquare();
			
			square.addEventListener(MouseEvent.CLICK,squareClicked);
			
			square.rotationY=45;
			
			pp=new PerspectiveProjection();
			
			pp.fieldOfView=80;
			
			pp.projectionCenter=new Point(50,50);
			
			container.transform.perspectiveProjection=pp;
			
			/*
			Assigning pp to square instead of container, 
			as in the next line, makes square lose interactivity.
			*/
			
			//square.transform.perspectiveProjection=pp;
			
			/*
			Making container a 3D object by uncommenting the
			next line obliterates effects of pp.
			*/
			
			//container.z=0;
			
		}
		
		

      private function drawSquare():void {
		  
		    var color:Number=Math.random()*0xFFFFFF/2;
		 
		    square.graphics.clear();
			
			square.graphics.beginFill(color);
			
			square.graphics.drawRect(-50,-50,100,100);
			
			square.graphics.endFill();
			 
	}
	
	 private function squareClicked(e:MouseEvent):void {
	
	      drawSquare();
		
      }
	  
	  
      
		
	}
	
	
}

PespectiveProjection behaves counterintuitively in many ways. See for example:
http://www.flashandmath.com/flashcs4/pp/
Today I am working on another post for Flash and Math about quirky behavior of PerspectiveProjection.
Take care, Franto. It is nice to be in touch with you.
Barbara
.-= Barbara Kaskosz&#180;s last blog ..&lt;a href=&quot;http://www.flashandmath.com/flashcs4/cylinouter/&quot; rel=&quot;nofollow&quot;&gt;A Dramatic 3D Image Gallery in AS3 Flash Player 10&lt;/a&gt; =-.</description>
		<content:encoded><![CDATA[<p>Hi Franto,<br />
The answer to your question is to create a 2D container for your interactive object and to assign a custom PerspectiveProjection to the container and not to the object itself. Below is the code in a file PPTest.as that I assigned as the Document Class to a fla file (with 550 by 400 stage). Everything works fine.<br />
/*<br />
ActionScript 3 Tips by Barbara Kaskosz.</p>
<p><a href="http://www.flashandmath.com" rel="nofollow">http://www.flashandmath.com</a></p>
<p>Last modified: January 25, 2010. </p>
<p>*/</p>
<p>package {</p>
<p>	 import flash.display.Sprite;</p>
<p>     import flash.events.MouseEvent;</p>
<p>     import flash.geom.PerspectiveProjection;</p>
<p>	 import flash.geom.Point;</p>
<p>   public class PPTest extends Sprite {</p>
<p>	  private var container:Sprite;</p>
<p>	  private var square:Sprite;</p>
<p>	  private var pp:PerspectiveProjection;</p>
<p>	  public function PPTest(){</p>
<p>			container=new Sprite();</p>
<p>			this.addChild(container);</p>
<p>			container.x=400;</p>
<p>			container.y=60;</p>
<p>			square=new Sprite();</p>
<p>			container.addChild(square);</p>
<p>			square.x=50;</p>
<p>			square.y=50;</p>
<p>			drawSquare();</p>
<p>			square.addEventListener(MouseEvent.CLICK,squareClicked);</p>
<p>			square.rotationY=45;</p>
<p>			pp=new PerspectiveProjection();</p>
<p>			pp.fieldOfView=80;</p>
<p>			pp.projectionCenter=new Point(50,50);</p>
<p>			container.transform.perspectiveProjection=pp;</p>
<p>			/*<br />
			Assigning pp to square instead of container,<br />
			as in the next line, makes square lose interactivity.<br />
			*/</p>
<p>			//square.transform.perspectiveProjection=pp;</p>
<p>			/*<br />
			Making container a 3D object by uncommenting the<br />
			next line obliterates effects of pp.<br />
			*/</p>
<p>			//container.z=0;</p>
<p>		}</p>
<p>      private function drawSquare():void {</p>
<p>		    var color:Number=Math.random()*0xFFFFFF/2;</p>
<p>		    square.graphics.clear();</p>
<p>			square.graphics.beginFill(color);</p>
<p>			square.graphics.drawRect(-50,-50,100,100);</p>
<p>			square.graphics.endFill();</p>
<p>	}</p>
<p>	 private function squareClicked(e:MouseEvent):void {</p>
<p>	      drawSquare();</p>
<p>      }</p>
<p>	}</p>
<p>}</p>
<p>PespectiveProjection behaves counterintuitively in many ways. See for example:<br />
<a href="http://www.flashandmath.com/flashcs4/pp/" rel="nofollow">http://www.flashandmath.com/flashcs4/pp/</a><br />
Today I am working on another post for Flash and Math about quirky behavior of PerspectiveProjection.<br />
Take care, Franto. It is nice to be in touch with you.<br />
Barbara<br />
<span class="cluv"> Barbara Kaskosz&#180;s last blog ..<a href="http://www.flashandmath.com/flashcs4/cylinouter/" rel="nofollow">A Dramatic 3D Image Gallery in AS3 Flash Player 10</a> <span class="heart_tip_box"><img class="heart_tip" alt="My ComLuv Profile" border="0" width="16" height="14" src="http://franto.com/blog2/wp-content/plugins/commentluv/images/littleheart.gif"/></span></span></p>
]]></content:encoded>
	</item>
</channel>
</rss>
