<?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>publicreative lab &#187; AS3DMod</title>
	<atom:link href="http://lab.publicreative.com/tag/as3dmod/feed/" rel="self" type="application/rss+xml" />
	<link>http://lab.publicreative.com</link>
	<description></description>
	<lastBuildDate>Tue, 27 Jul 2010 15:59:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PV3D with AS3DMod and Shaders</title>
		<link>http://lab.publicreative.com/2009/01/pv3d-with-as3dmod-and-shaders/</link>
		<comments>http://lab.publicreative.com/2009/01/pv3d-with-as3dmod-and-shaders/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 19:45:40 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[AS3DMod]]></category>
		<category><![CDATA[Papervision]]></category>
		<category><![CDATA[shaders]]></category>

		<guid isPermaLink="false">http://lab.publicreative.com/?p=30</guid>
		<description><![CDATA[<script type="text/javascript" src="http://lab.publicreative.com/wp-includes/js/jquery/jquery.js"></script><script type="text/javascript" src="http://lab.publicreative.com/wp-content/plugins/pb-embedflash/js/sbadapter/shadowbox-jquery.js"></script><script type="text/javascript" src="http://lab.publicreative.com/wp-content/plugins/pb-embedflash/js/shadowbox.js"></script><script type="text/javascript"><!--
window.onload = function() {var options ={assetURL:'',loadingImage:'http://lab.publicreative.com/wp-content/plugins/pb-embedflash/css/images/loading.gif',flvPlayer:'http://lab.publicreative.com/wp-content/plugins/pb-embedflash/swf/mediaplayer.swf',animate:true,animSequence:'wh',overlayColor:'#000',overlayOpacity:0.9,overlayBgImage:'http://lab.publicreative.com/wp-content/plugins/pb-embedflash/css/images/overlay-85.png',listenOverlay:true,autoplayMovies:true,showMovieControls:true,resizeDuration:0.35,fadeDuration:0.35,displayNav:true,continuous:false,displayCounter:true,counterType:'default',viewportPadding:20,handleLgImages:'resize',initialHeight:160,initialWidth:320,enableKeys:true,keysClose:['c', 'q', 27],keysPrev:['p', 37],keysNext:['n', 39],handleUnsupported:'',text: {cancel:'Cancel',loading: 'loading',close:'<span class="shortcut">C</span>lose',next:'<span class="shortcut">N</span>ext',prev:'<span class="shortcut">P</span>revious',errors:{single: 'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared: 'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either: 'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}}};Shadowbox.init(options);}
--></script>This was my first attempt at using the AS3DMod Library so you can see where the previously posted example came from.
I&#8217;ve also added gouraud shading to make it a little more interesting.
Click image to open:
(Please open the article to see the flash file or player.)

Here is the source:

package
&#123;
	import com.as3dmod.ModifierStack;
	import com.as3dmod.modifiers.Perlin;
	import com.as3dmod.plugins.pv3d.LibraryPv3d;
&#160;
	import flash.display.Bitmap;
	import flash.display.Loader;
	import flash.display.StageAlign;
	import flash.display.StageQuality;
	import [...]]]></description>
			<content:encoded><![CDATA[<p>This was my first attempt at using the <a href="http://code.google.com/p/as3dmod/">AS3DMod</a> Library so you can see where the previously posted example came from.</p>
<p>I&#8217;ve also added gouraud shading to make it a little more interesting.</p>
<p><strong>Click image to open:</strong></p>
<p><small>(Please open the article to see the flash file or player.)</small></p>
<p><span id="more-30"></span><br />
<strong>Here is the source:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3 actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.ModifierStack;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.modifiers.Perlin;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.plugins.pv3d.LibraryPv3d;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Bitmap</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Loader</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageAlign</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageQuality</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageScaleMode</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.lights.PointLight3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.BitmapMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.shaders.GouraudShader;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.shaders.ShadedMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Plane;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
&nbsp;
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;600&quot;</span>, <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;400&quot;</span>, <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;#000000&quot;</span>, <span style="color: #004993;">frameRate</span>=<span style="color: #990000;">&quot;31&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> PublicFlag extends BasicView
	<span style="color: #000000;">&#123;</span>
		<span style="color: #000000;">&#91;</span>Embed<span style="color: #000000;">&#40;</span><span style="color: #004993;">source</span>=<span style="color: #990000;">&quot;assets/flagLogo.gif&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> Flag<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Class</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _plane<span style="color: #000000; font-weight: bold;">:</span>Plane;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _mod<span style="color: #000000; font-weight: bold;">:</span>ModifierStack;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _perlin<span style="color: #000000; font-weight: bold;">:</span>Perlin;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _xPhaseVal<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = 0;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _yPhaseVal<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = 0;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _targXPhaseVal<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = 0;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _targYPhaseVal<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = 0;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _light<span style="color: #000000; font-weight: bold;">:</span>PointLight3D;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> PublicFlag<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span>, <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">scaleMode</span> = <span style="color: #004993;">StageScaleMode</span>.<span style="color: #004993;">NO_SCALE</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">align</span> = <span style="color: #004993;">StageAlign</span>.<span style="color: #004993;">TOP_LEFT</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">stageFocusRect</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
			_light = <span style="color: #0033ff; font-weight: bold;">new</span> PointLight3D<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_light.z = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">100</span>;
			_light.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">100</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> logo<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Bitmap</span> = <span style="color: #0033ff; font-weight: bold;">new</span> Flag<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Bitmap</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> shader<span style="color: #000000; font-weight: bold;">:</span>GouraudShader = <span style="color: #0033ff; font-weight: bold;">new</span> GouraudShader<span style="color: #000000;">&#40;</span> _light , 0xffffff , 0x555555 , <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> mat<span style="color: #000000; font-weight: bold;">:</span>ShadedMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ShadedMaterial<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> BitmapMaterial<span style="color: #000000;">&#40;</span> logo.<span style="color: #004993;">bitmapData</span><span style="color: #000000;">&#41;</span> , shader<span style="color: #000000;">&#41;</span>;
			mat.doubleSided = <span style="color: #0033ff; font-weight: bold;">true</span>;
			_plane = <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span> mat , logo.<span style="color: #004993;">width</span> , logo.<span style="color: #004993;">height</span> , <span style="color: #000000; font-weight:bold;">12</span>, <span style="color: #000000; font-weight:bold;">8</span><span style="color: #000000;">&#41;</span>;
			_plane.useOwnContainer = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			camera.fov=<span style="color: #000000; font-weight:bold;">34</span>;
			scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> _plane <span style="color: #000000;">&#41;</span>;
&nbsp;
			modify<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			startRendering<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> modify<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			 _mod = <span style="color: #0033ff; font-weight: bold;">new</span> ModifierStack<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> LibraryPv3d<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , _plane <span style="color: #000000;">&#41;</span>;
&nbsp;
			_perlin = <span style="color: #0033ff; font-weight: bold;">new</span> Perlin<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000;">&#41;</span>;
			_perlin.setFalloff<span style="color: #000000;">&#40;</span> 0 , <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
			_mod.addModifier<span style="color: #000000;">&#40;</span> _perlin <span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> onRenderTick<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span>=<span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
		 	_xPhaseVal = <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">mouseX</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span>;
		 	_plane.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">160</span><span style="color: #000000; font-weight: bold;">*</span>_xPhaseVal<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">-</span>_plane.rotationY<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">10</span>;
&nbsp;
		 	_yPhaseVal = <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">mouseY</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span>;
		 	_plane.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">100</span> <span style="color: #000000; font-weight: bold;">*</span> _yPhaseVal<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> _plane.rotationX<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">10</span>;
&nbsp;
			_mod.<span style="color: #004993;">apply</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">super</span>.onRenderTick<span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lab.publicreative.com/2009/01/pv3d-with-as3dmod-and-shaders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PV3D Page Flip with AS3Dmod and Effects</title>
		<link>http://lab.publicreative.com/2009/01/pv3d-page-flip-with-as3dmod-and-effects/</link>
		<comments>http://lab.publicreative.com/2009/01/pv3d-page-flip-with-as3dmod-and-effects/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 17:52:58 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[AS3DMod]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Papervision]]></category>

		<guid isPermaLink="false">http://lab.publicreative.com/?p=7</guid>
		<description><![CDATA[We’ve made sites using Papervision in the past, but I’ve had a bit of time to really get to know it a lot better. There has been so much functionality added lately it’s hard to keep up!
I’ve also really enjoyed playing with the AS3Dmod library by Bartek Drozdz and using BitmapEffectLayer’s
The following project started as [...]]]></description>
			<content:encoded><![CDATA[<p>We’ve made sites using Papervision in the past, but I’ve had a bit of time to really get to know it a lot better. There has been so much functionality added lately it’s hard to keep up!</p>
<p>I’ve also really enjoyed playing with the AS3Dmod library by <a href="http://www.everydayflash.com/">Bartek Drozdz</a> and using <a href="http://blog.zupko.info/?p=129">BitmapEffectLayer’s</a></p>
<p>The following project started as a simple idea for a gallery to showcase work that we have done but eventually evolved into more of a personal indulgence. Click anywhere to flip the page over.</p>
<p>To get the two sided Plane effect I’ve simply used a Cube that is 1px deep. The thing that frustrated me the most was trying to get the MovieMaterial holding the content of the image Loader instance to render the correct size. Initially I was creating the MovieMaterial’s at the same time I was initialising the Loaders but as there was no content in the loaders yet, the MovieMaterial rendered at its default size.</p>
<p>To fix this I initially assign a place holder Sprite that is the correct size to the MovieMaterial objects. Then when the Loader finishes loading the asset I switch the MovieMaterial that contains the Sprite for a new MovieMaterial that contains the image data from the Loader. This also means that the MovieMaterial does not have to be animated (updated on each render loop) improving performance.</p>
<p>It took me a long time find the method to replace materials, but it should have been pretty obvious.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3 actionscript3" style="font-family:monospace;">_cube.replaceMaterialByName<span style="color: #000000;">&#40;</span> <span style="color: #3f5fbf;">/* new material */</span> , <span style="color: #3f5fbf;">/* material name */</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p><strong>Click image to open: Click again to flip:</strong></p>
<p><small>(Please open the article to see the flash file or player.)</small></p>
<p>Also thanks to Zack Jordan for sharing his <a href="http://pixelwelders.com/blog/best-practices/2008/flashflex-integration-swflibrary-v15/">SWFLibrary</a> class.</p>
<p><span id="more-7"></span></p>
<p><strong>Here is the source:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3 actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> 
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.ModifierStack;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.modifiers.Bend;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.modifiers.Perlin;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.plugins.pv3d.LibraryPv3d;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.util.ModConstant;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.as3dmod.util.Phase;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.pixelwelders.util.SWFLibrary;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.publicreative.utils.MathUtils;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">BlendMode</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Loader</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageAlign</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageQuality</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageScaleMode</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.filters</span>.<span style="color: #004993;">BlurFilter</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLLoader</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLRequest</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> gs.TweenLite;
	<span style="color: #0033ff; font-weight: bold;">import</span> gs.easing.<span style="color: #000000; font-weight: bold;">*</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.core.effects.BitmapLayerEffect;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.ColorMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.MovieMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.utils.MaterialsList;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Cube;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Plane;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.layer.BitmapEffectLayer;
&nbsp;
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;560&quot;</span>, <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;295&quot;</span>, <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;#ffffff&quot;</span>, <span style="color: #004993;">frameRate</span>=<span style="color: #990000;">&quot;31&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>	
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> PVModBedHeader extends BasicView
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _plane<span style="color: #000000; font-weight: bold;">:</span>Plane;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _mod<span style="color: #000000; font-weight: bold;">:</span>ModifierStack;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _bend<span style="color: #000000; font-weight: bold;">:</span>Bend;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _planeMouseX<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _planeMouseY<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _tweenX<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = 0;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _tweenY<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>= 0;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _perlin<span style="color: #000000; font-weight: bold;">:</span>Perlin;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _phase<span style="color: #000000; font-weight: bold;">:</span>Phase;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _tweenObj<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _tweenObj2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _tweenObj3<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _flipping<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _modified<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _effects<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _firstFlip<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _imageLoader1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Loader</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _imageLoader2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Loader</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _cube<span style="color: #000000; font-weight: bold;">:</span>Cube;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _data<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">XML</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _lib<span style="color: #000000; font-weight: bold;">:</span>SWFLibrary;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _dataIndex<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = 0;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _header<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MovieClip</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _body<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MovieClip</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _link<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MovieClip</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _bendStrength<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">0.4</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _side<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = 0;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _bitmapEffectLayer<span style="color: #000000; font-weight: bold;">:</span>BitmapEffectLayer;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _blur<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">BlurFilter</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> const BASE_DIR<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;http://lab.publicreative.com/uploads/modBendHeader/&quot;</span>;
&nbsp;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> PVModBedHeader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span>, <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">quality</span> = <span style="color: #004993;">StageQuality</span>.<span style="color: #004993;">MEDIUM</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">scaleMode</span> = <span style="color: #004993;">StageScaleMode</span>.<span style="color: #004993;">NO_SCALE</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">align</span> = <span style="color: #004993;">StageAlign</span>.<span style="color: #004993;">TOP_LEFT</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> xmlLoader<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLLoader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLLoader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			xmlLoader.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span> , onData , <span style="color: #0033ff; font-weight: bold;">false</span> , 0 , <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			xmlLoader.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span> BASE_DIR<span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;xml/assets.xml&quot;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Once the image data has loaded start rendering and add effects
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onData<span style="color: #000000;">&#40;</span>ev<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_data = <span style="color: #004993;">XML</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">URLLoader</span><span style="color: #000000;">&#40;</span>ev.<span style="color: #004993;">target</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">data</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			_lib = <span style="color: #0033ff; font-weight: bold;">new</span> SWFLibrary<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_lib.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span> , onLibComplete , <span style="color: #0033ff; font-weight: bold;">false</span> , 0 , <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			_lib.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span> BASE_DIR<span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;assets.swf&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			renderInit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Setup papervision and materials and start rendering
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> renderInit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span> , onFlip , <span style="color: #0033ff; font-weight: bold;">false</span> , 0 , <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #009900;">// LOADERS.. one for each side of the plane</span>
			_imageLoader1 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Loader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_imageLoader1.<span style="color: #004993;">contentLoaderInfo</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span> , onLoad1Complete , <span style="color: #0033ff; font-weight: bold;">false</span> , 0 , <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			_imageLoader1.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span> BASE_DIR<span style="color: #000000; font-weight: bold;">+</span>_data.image<span style="color: #000000;">&#91;</span>_dataIndex<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			_imageLoader2 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Loader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_imageLoader2.<span style="color: #004993;">contentLoaderInfo</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span> , onLoad2Complete , <span style="color: #0033ff; font-weight: bold;">false</span> , 0 , <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			_imageLoader2.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span>BASE_DIR<span style="color: #000000; font-weight: bold;">+</span> _data.image<span style="color: #000000;">&#91;</span>_dataIndex<span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #009900;">// PUT IN A PLACEHOLDER SPRITE TO FORCE THE RIGHT SIZE FOR THE LOADED IMAGES!</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> sprite<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xffffff<span style="color: #000000;">&#41;</span>;
			sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span>0,0,<span style="color: #000000; font-weight:bold;">454</span>,<span style="color: #000000; font-weight:bold;">294</span><span style="color: #000000;">&#41;</span>;
			sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> mt1<span style="color: #000000; font-weight: bold;">:</span>MovieMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> MovieMaterial<span style="color: #000000;">&#40;</span> sprite, <span style="color: #0033ff; font-weight: bold;">false</span> , <span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> mt2<span style="color: #000000; font-weight: bold;">:</span>MovieMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> MovieMaterial<span style="color: #000000;">&#40;</span> sprite, <span style="color: #0033ff; font-weight: bold;">false</span> , <span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
			mt1.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
			mt2.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> emptyMat<span style="color: #000000; font-weight: bold;">:</span>ColorMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ColorMaterial<span style="color: #000000;">&#40;</span> 0xffffff ,0<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #009900;">// MATERIALS.. materials with loaders on two sides all other materials transparent color material</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> mats<span style="color: #000000; font-weight: bold;">:</span>MaterialsList = <span style="color: #0033ff; font-weight: bold;">new</span> MaterialsList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			mats.addMaterial<span style="color: #000000;">&#40;</span> emptyMat, <span style="color: #990000;">&quot;bottom&quot;</span><span style="color: #000000;">&#41;</span>;
			mats.addMaterial<span style="color: #000000;">&#40;</span> emptyMat , <span style="color: #990000;">&quot;top&quot;</span> <span style="color: #000000;">&#41;</span>;
			mats.addMaterial<span style="color: #000000;">&#40;</span> emptyMat , <span style="color: #990000;">&quot;left&quot;</span><span style="color: #000000;">&#41;</span>;
			mats.addMaterial<span style="color: #000000;">&#40;</span> emptyMat , <span style="color: #990000;">&quot;right&quot;</span><span style="color: #000000;">&#41;</span>;
			mats.addMaterial<span style="color: #000000;">&#40;</span> mt2 , <span style="color: #990000;">&quot;front&quot;</span> <span style="color: #000000;">&#41;</span>;
			mats.addMaterial<span style="color: #000000;">&#40;</span> mt1 , <span style="color: #990000;">&quot;back&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #009900;">// CUBE.. that appears as a plane with two sides</span>
			_cube = <span style="color: #0033ff; font-weight: bold;">new</span> Cube<span style="color: #000000;">&#40;</span> mats, <span style="color: #000000; font-weight:bold;">454</span>, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">294</span>, <span style="color: #000000; font-weight:bold;">20</span>, <span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000;">&#41;</span>;
			_cube.useOwnContainer = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			<span style="color: #009900;">// CAMERA..</span>
			camera.fov = <span style="color: #000000; font-weight:bold;">40</span>;
			camera.<span style="color: #004993;">zoom</span> = <span style="color: #000000; font-weight:bold;">90</span>;
			scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> _cube<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #009900;">// USING OBJECTS TO STORE TWEEN VALUES..</span>
			_tweenObj = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_tweenObj2 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_tweenObj2.flipValue = 0;
			_tweenObj3 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_tweenObj3.bendValue = <span style="color: #000000; font-weight: bold;">-</span>_bendStrength;
&nbsp;
			modifyInit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			effectsInit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Add bitmap effects layer for blur when flipping
		 * The amount of blur is animated as the cube flips
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> effectsInit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_effects = <span style="color: #0033ff; font-weight: bold;">true</span>;
			_bitmapEffectLayer = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapEffectLayer<span style="color: #000000;">&#40;</span> viewport , <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span> , <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span><span style="color: #000000;">&#41;</span>;
			_bitmapEffectLayer.renderAbove = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			viewport.containerSprite.addLayer<span style="color: #000000;">&#40;</span> _bitmapEffectLayer <span style="color: #000000;">&#41;</span>; 
&nbsp;
			_bitmapEffectLayer.addDisplayObject3D<span style="color: #000000;">&#40;</span> _cube <span style="color: #000000;">&#41;</span>;
			_blur = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">BlurFilter</span><span style="color: #000000;">&#40;</span>0,0<span style="color: #000000;">&#41;</span>;
			_blur.<span style="color: #004993;">quality</span> = <span style="color: #000000; font-weight:bold;">2</span>;
			_bitmapEffectLayer.addEffect<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> BitmapLayerEffect<span style="color: #000000;">&#40;</span> _blur <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			_bitmapEffectLayer.clearBeforeRender = <span style="color: #0033ff; font-weight: bold;">true</span>;
			_bitmapEffectLayer.drawLayer.<span style="color: #004993;">blendMode</span> = <span style="color: #004993;">BlendMode</span>.<span style="color: #004993;">ADD</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * ADD the background from the assets.swf
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onLibComplete<span style="color: #000000;">&#40;</span>ev<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">background</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = _lib.getSprite<span style="color: #000000;">&#40;</span> <span style="color: #990000;">&quot;Background&quot;</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChildAt</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">background</span> , 0 <span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 *  APPLY BEND AND PERLIN MODIFICATIONS
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> modifyInit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_modified = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			_mod = <span style="color: #0033ff; font-weight: bold;">new</span> ModifierStack<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> LibraryPv3d<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , _cube <span style="color: #000000;">&#41;</span>;
&nbsp;
			_bend = <span style="color: #0033ff; font-weight: bold;">new</span> Bend<span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight: bold;">-</span>_bendStrength<span style="color: #000000;">&#41;</span>;
			_bend.constraint = ModConstant.<span style="color: #004993;">NONE</span>;
&nbsp;
			_tweenX = <span style="color: #000000; font-weight:bold;">0.5</span>;
			_tweenY = 0;
&nbsp;
			_perlin = <span style="color: #0033ff; font-weight: bold;">new</span> Perlin<span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">0.5</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
			_mod.addModifier<span style="color: #000000;">&#40;</span> _perlin <span style="color: #000000;">&#41;</span>;  
			_mod.addModifier<span style="color: #000000;">&#40;</span> _bend <span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * AS MATERIALS are only placeholder sprites
		 * we must swap them out for the correct moviematerial containing the image loaders
		 * we can also unload the image once the loader is written to the movie material
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onLoad1Complete<span style="color: #000000;">&#40;</span>ev<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> mt1<span style="color: #000000; font-weight: bold;">:</span>MovieMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> MovieMaterial<span style="color: #000000;">&#40;</span> _imageLoader1 , <span style="color: #0033ff; font-weight: bold;">false</span> , <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span>;
			mt1.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
			_cube.replaceMaterialByName<span style="color: #000000;">&#40;</span> mt1 , <span style="color: #990000;">&quot;back&quot;</span> <span style="color: #000000;">&#41;</span>;
			mt1 = <span style="color: #0033ff; font-weight: bold;">null</span>;
			_imageLoader1.<span style="color: #004993;">unload</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_firstFlip<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				TweenLite.from<span style="color: #000000;">&#40;</span> _cube,<span style="color: #000000; font-weight:bold;">2</span>, <span style="color: #000000;">&#123;</span>z<span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;">8000</span> , ease<span style="color: #000000; font-weight: bold;">:</span>Expo.easeOut <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
				startRendering<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onLoad2Complete<span style="color: #000000;">&#40;</span>ev<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> mt2<span style="color: #000000; font-weight: bold;">:</span>MovieMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> MovieMaterial<span style="color: #000000;">&#40;</span> _imageLoader2 , <span style="color: #0033ff; font-weight: bold;">false</span> , <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span>;
			mt2.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
			_cube.replaceMaterialByName<span style="color: #000000;">&#40;</span> mt2 , <span style="color: #990000;">&quot;front&quot;</span> <span style="color: #000000;">&#41;</span>;
			mt2 = <span style="color: #0033ff; font-weight: bold;">null</span>;
			_imageLoader2.<span style="color: #004993;">unload</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/** 
		 * If the cube isn't flipping already.. flip it!
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFlip<span style="color: #000000;">&#40;</span>ev<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>_flipping<span style="color: #000000;">&#41;</span> flip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Tween the tween values and make it flip!
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> flip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_flipping = <span style="color: #0033ff; font-weight: bold;">true</span>;
			_firstFlip = <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
			_tweenObj.tweenValue = 0;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> flipTo<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = _tweenObj2.flipValue <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> bendTo<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span>_tweenObj3.bendValue <span style="color: #000000; font-weight: bold;">&gt;</span> 0<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">3</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">3</span>;
&nbsp;
			TweenLite.to<span style="color: #000000;">&#40;</span> _tweenObj ,<span style="color: #000000; font-weight:bold;">1.5</span> , <span style="color: #000000;">&#123;</span> tween<span style="color: #000000; font-weight: bold;">:</span>Quad.easeIn , tweenValue<span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;">1</span>, onComplete<span style="color: #000000; font-weight: bold;">:</span>flipOut <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
			TweenLite.to<span style="color: #000000;">&#40;</span> _tweenObj2 , <span style="color: #000000; font-weight:bold;">3</span> , <span style="color: #000000;">&#123;</span> tween<span style="color: #000000; font-weight: bold;">:</span>Sine.easeInOut , flipValue<span style="color: #000000; font-weight: bold;">:</span>flipTo  <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
			TweenLite.to<span style="color: #000000;">&#40;</span> _tweenObj3 , <span style="color: #000000; font-weight:bold;">1.5</span> , <span style="color: #000000;">&#123;</span> tween<span style="color: #000000; font-weight: bold;">:</span>Quad.easeIn , bendValue<span style="color: #000000; font-weight: bold;">:</span>bendTo <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			_side = _tweenObj2.flipValue<span style="color: #000000; font-weight: bold;">%</span>2;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Half way through the flip
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> flipOut<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> bendTo<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span>_tweenObj3.bendValue <span style="color: #000000; font-weight: bold;">&gt;</span> 0<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight: bold;">-</span>_bendStrength <span style="color: #000000; font-weight: bold;">:</span> _bendStrength;
&nbsp;
			TweenLite.to<span style="color: #000000;">&#40;</span> _tweenObj ,<span style="color: #000000; font-weight:bold;">1.5</span> , <span style="color: #000000;">&#123;</span> tween<span style="color: #000000; font-weight: bold;">:</span>Quad.easeOut, tweenValue<span style="color: #000000; font-weight: bold;">:</span>0 , onComplete<span style="color: #000000; font-weight: bold;">:</span>flipComplete <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
			TweenLite.to<span style="color: #000000;">&#40;</span> _tweenObj3 , <span style="color: #000000; font-weight:bold;">1.5</span> , <span style="color: #000000;">&#123;</span> tween<span style="color: #000000; font-weight: bold;">:</span>Quad.easeIn , bendValue<span style="color: #000000; font-weight: bold;">:</span>bendTo <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			_dataIndex<span style="color: #000000; font-weight: bold;">++</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_dataIndex<span style="color: #000000; font-weight: bold;">&gt;</span>_data.image.<span style="color: #004993;">length</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> _dataIndex =0;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Finish the flip and load the next image on the reverse side
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> flipComplete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_flipping = <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> targetLoader<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Loader</span> = <span style="color: #000000;">&#40;</span>_side<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> _imageLoader2 <span style="color: #000000; font-weight: bold;">:</span> _imageLoader1;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> ind<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = _dataIndex<span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">1</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>ind <span style="color: #000000; font-weight: bold;">&gt;</span> _data.image.<span style="color: #004993;">length</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> ind = 0;
			targetLoader.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span> BASE_DIR<span style="color: #000000; font-weight: bold;">+</span> _data.image<span style="color: #000000;">&#91;</span>ind<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Render the 3D scene every frame
		 */</span>
		override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> onRenderTick<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span>.onRenderTick<span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_modified <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				_planeMouseX = <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">-</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">stage</span>.<span style="color: #004993;">mouseX</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span> ;
				_planeMouseY = <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">-</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">stage</span>.<span style="color: #004993;">mouseY</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_planeMouseX <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> _planeMouseX = <span style="color: #000000; font-weight:bold;">0.99</span>;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_planeMouseX <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> _planeMouseX = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">0.99</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_flipping<span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#123;</span>
					_cube.rotationY = <span style="color: #000000; font-weight:bold;">180</span><span style="color: #000000; font-weight: bold;">*</span>_tweenObj2.flipValue;
					_planeMouseX <span style="color: #000000; font-weight: bold;">*</span>= <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">-</span> _tweenObj.tweenValue<span style="color: #000000;">&#41;</span>;
					_bend.force=  _tweenObj3.bendValue;
					camera.<span style="color: #004993;">zoom</span> = <span style="color: #000000; font-weight:bold;">90</span><span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000;">&#40;</span>_tweenObj.tweenValue <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">50</span><span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_effects<span style="color: #000000;">&#41;</span> _blur.<span style="color: #004993;">blurX</span> = _blur.<span style="color: #004993;">blurY</span> = _tweenObj.tweenValue<span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">10</span>;
				<span style="color: #000000;">&#125;</span>
&nbsp;
				_tweenX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000;">&#40;</span> _planeMouseX <span style="color: #000000; font-weight: bold;">-</span> _tweenX <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>;
				_tweenY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000;">&#40;</span> _planeMouseY <span style="color: #000000; font-weight: bold;">-</span> _tweenY <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">10</span>;
&nbsp;
				_bend.<span style="color: #004993;">offset</span> = <span style="color: #000000; font-weight:bold;">0.5</span> <span style="color: #000000; font-weight: bold;">+</span> _tweenX;
&nbsp;
				_bend.<span style="color: #004993;">angle</span> = MathUtils.toRadians<span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">90</span> <span style="color: #000000; font-weight: bold;">*</span> _tweenY <span style="color: #000000;">&#41;</span>;
&nbsp;
				_mod.<span style="color: #004993;">apply</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lab.publicreative.com/2009/01/pv3d-page-flip-with-as3dmod-and-effects/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
