<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Wwwebber&#039;s Blog</title>
	<atom:link href="http://wwwebber.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wwwebber.wordpress.com</link>
	<description>PHP, MySQL and ActionScript</description>
	<lastBuildDate>Fri, 27 Jan 2012 10:59:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='wwwebber.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Wwwebber&#039;s Blog</title>
		<link>http://wwwebber.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://wwwebber.wordpress.com/osd.xml" title="Wwwebber&#039;s Blog" />
	<atom:link rel='hub' href='http://wwwebber.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Free Online Mortgage Calculator</title>
		<link>http://wwwebber.wordpress.com/2012/01/24/free-online-mortgage-calculator/</link>
		<comments>http://wwwebber.wordpress.com/2012/01/24/free-online-mortgage-calculator/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 10:50:19 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=248</guid>
		<description><![CDATA[I wanted to write a quick post about a very cool free online mortgage calculator &#8211; If, like me, you are not the most knowledge about amortization tables, 30 vs 15 year mortgages, and the like, then this calculator might help out a bit. It not only shows the monthly payments, but also creates charts [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=248&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted to write a quick post about a very<a title="Online Mortgage Calculator" href="http://www.meta-calculator.com/mortgage/"> cool free online mortgage calculator </a>&#8211; If, like me, you are not the most knowledge about<a href="http://mathscoop.com/mortgages/loan-amortization-table.php"> amortization tables</a>, 30 vs 15 year mortgages, and the like, then this calculator might help out a bit. It not only shows the monthly payments, but also creates charts showing the amortization schedule.</p>
<p>&nbsp;</p>
<p>Very cool. Check it out.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/248/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=248&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2012/01/24/free-online-mortgage-calculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>
	</item>
		<item>
		<title>Box2d 2.1 How to use a b2Controller</title>
		<link>http://wwwebber.wordpress.com/2010/07/09/box2d-how-to-use-a-b2controller/</link>
		<comments>http://wwwebber.wordpress.com/2010/07/09/box2d-how-to-use-a-b2controller/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 02:51:38 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[Box2d]]></category>
		<category><![CDATA[Box2d 2.1]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=213</guid>
		<description><![CDATA[Box2d 2.1 brought some awesome improvements 1) improved class structure. 2) buyouncy support 3) a set of Controller Classes that are well described by the docs as &#8221; a convience for encapsulating common per-step functionality.&#8221; (read about them here) These improvements were actually worth the fact that none of your prior Box2d code (and I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=213&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Box2d 2.1 brought some awesome improvements<br />
1) improved class structure.<br />
2) buyouncy support<br />
3) a set of Controller Classes that are well described by the docs as &#8221; a convience for encapsulating common per-step functionality.&#8221;   (<a href="http://www.box2dflash.org/docs/2.1a/reference/">read about them here</a>) </p>
<p>These improvements were actually worth the fact that none of your prior Box2d code (and I mean none) would compile with the new class structure.</p>
<p>If you used earlier versions of Bo2D, you already used something like these controllers&#8211;the Gravity Vector that you passed to the world object at construction.<br />
This was a b2Vec2  (the gravity) that the world applied to all non-static objects. Ie the walls wouldn&#8217;t be affected by the gravity vector but all the moving objects would be affected by a constant force downwards (unless your gravity had an unusual orientation) </p>
<p>There are several types of controllers and they all extends b2Controller . The TestBuoyancy class   that comes with the TestBed shows an example of how to use the b2BuoyancyController .</p>
<p><strong><em>All of the controllers have the following methods</em></strong></p>
<p><em>AddBody(body:b2Body):void<br />
RemoveBody(body:b2Body):void<br />
</em></p>
<p>I was interested in using a b2ConstantAccelController. There aren&#8217;t really any examples out there for this (at least that I could find) so here&#8217;s how easy it is to implement a  b2ConstantAccelController&#8211;which will just apply an additional vector each time step to any bodies added to that controller.</p>
<p>Now, unlike the GravityVector you can arbitrarily add and remove objects from the controller. How could this be useful? Imagine that you have gusts of wind blowing sideways&#8230;you can add your objects to a Contoller and have them pushed sideways&#8230;then when the wind passes you could remove them from that controller.</p>
<p><strong>How to create a b2ConstantAccelController :</strong></p>
<p><em>//construct object and its acceleration vector<br />
var myAccelController:b2ConstantAccelController = new b2ConstantAccelController();<br />
const WIND_VEC :b2Vec2 = new b2Vec2(10,0);<br />
//associate controller with vector<br />
myAccelController.A = WIND_VEC</p>
<p>Henceforth, all b2bodies that are stored in myAccelController will have the WIND_VEC applied to them during the b2World.step()   function .. you don&#8217;t have to do anything else except add and remove bodies to the controller.</p>
<p><em>//now let&#8217;s add something to the Controller<br />
myAccelController.AddBody(someB2Body);</p>
<p>&#8230;when you want to remove the body<br />
myAccelController.RemoveBody(someB2Body);<br />
</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=213&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2010/07/09/box2d-how-to-use-a-b2controller/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>
	</item>
		<item>
		<title>Actionscript 3 Tween Library Skinner&#8217;s Gtween vs Greensock&#8217;s tweenlite</title>
		<link>http://wwwebber.wordpress.com/2010/07/05/actionscript-3-tween-library-skinner-gtween-vs-greensocks-tweenlite/</link>
		<comments>http://wwwebber.wordpress.com/2010/07/05/actionscript-3-tween-library-skinner-gtween-vs-greensocks-tweenlite/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 12:34:19 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[Tween Library]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=204</guid>
		<description><![CDATA[Just wanted to add a little extra feed back for anyone who is currently trying to decide on an Actionscript 3 tween library. There are many other to choose from. I spent some time over the last month playing with both Grant Skinner&#8217;s GTween library and GreenSock&#8217;s TweenLight library . In a nutshell, you can&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=204&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just wanted to add a little extra feed back for anyone who is currently trying to <a href="http://theflashblog.com/?p=516">decide on an Actionscript 3 tween library</a>. There are many other to choose from. I spent some time over the last month playing with both Grant Skinner&#8217;s <a href="http://www.gskinner.com/libraries/gtween/">GTween</a> library and <a href="http://www.greensock.com/tweenlite/">GreenSock&#8217;s TweenLight</a> library  . In a nutshell, you can&#8217;t go wrong with either one. Both are awesome and I&#8217;m glad someone did almost all that heavy lifting!</p>
<p>However, after using both libraries over the course of the development of my most recent <a href="http://themathgames.com/">online maths games</a> &#8211;<a href="http://rjtherobot.com/"> Rj The Robot </a> on the topic of <a href="http://www.mathwarehouse.com/algebra/like-terms/how-to-combine-like-terms-in-math.php">how to combine like terms</a>.</p>
<p><strong>First off, why both libraries ROCK!</strong><br />
-Awesome levels of customization of tween types (sinusodal, Bounce etc..) the differences here are small. At the time of this post, Greensock has some that the GTween library does not .<br />
- Optimized performace.</p>
<p><strong>How they Differ</strong></p>
<p><strong><em>Object Model</em></strong><br />
<strong>Greensock</strong>&#8211; You can use either static based methods to create tweens or use good old OOP to create tween objects.<br />
<strong>GTween </strong>&#8211;it uses an object model, though a static based interface is also available</p>
<p>ie&#8211;they are pretty much the same here.</p>
<p><strong><em>Visualizers</em></strong><br />
<strong>Greensock </strong>wins this&#8211;it comes with an awesome component that let&#8217;s you visualize tweens and will actually output the code needed to create the tween! Go Greensock (see what I mean <a href="http://www.greensock.com/tweenlite/">here</a>)<br />
<strong>GTween</strong>&#8211;Do not think anything like this is provided.</p>
<p><strong><em>Events</em></strong><br />
<strong>Greensock</strong>- TweenLite does not include an event system. However, if events are important to you then you just use GreenSock&#8217;s TweenMax (also free).<br />
<strong>GTween</strong>- has a great event system.</p>
<p><strong><em>Error reporting</em></strong><br />
<strong>Greensock</strong>- Hands down wins in the experiments I ran. If you pass Greensock a null object, it will throw an Error reporting the null reference.<br />
<strong>GTween</strong>- In my tests, Gtween silently did nothing when I tried to tween a null object.<br />
The winner here is clearly the Greensock library.  <strong>Addendum: It turns out there is a reason for Gtween accepting null objects &#8211;read comments below.  That  said, Greensock allows the same chaining of events but reports null pointers.</strong></p>
<p>In the end, you really can&#8217;t go wrong with either library. They both support object oriented syntax, chaining of tweens,and event dispatching and listening (Greensock only does this with the TweenMax..which is also free). Greensock does have a few extra tween types , the awesome visualizer as well as some amazing plugins &#8211;all of which led me to go with using Greensock.</p>
<p>If I you know of any other differences that I missed (and I know there must be many), please fire off a quick comment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=204&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2010/07/05/actionscript-3-tween-library-skinner-gtween-vs-greensocks-tweenlite/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Actionscript to make Subscripts with Flash&#8217;s Text Layout Framework</title>
		<link>http://wwwebber.wordpress.com/2010/06/05/actionscript-subscripts-with-flash-text-layout-framework/</link>
		<comments>http://wwwebber.wordpress.com/2010/06/05/actionscript-subscripts-with-flash-text-layout-framework/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 01:10:05 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[Text Layout Framework]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=160</guid>
		<description><![CDATA[Here&#8217;s a quick post on on some new Actionscript functionality that takes advantage of Flash&#8217;s new Text Layout FrameWork to create subscript and superscipt in the new types of text fields that you can create&#8211;These new things aren&#8217;t the TextField() that you are used to but rather are part of this whole new, much more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=160&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick post on on some new Actionscript functionality that takes advantage of  Flash&#8217;s new Text Layout FrameWork to create subscript and superscipt in the new types of text fields that you can create&#8211;These new things aren&#8217;t the TextField() that you are used to but rather are part of this whole new, much more sophisticated framework.. I used Flash CS5, but this should work with CS4 also. Apparently, the Text Layout Framework (which is just a component that you can install with the extension manager) will work with CS4. </p>
<p>This post will show you how to use <em><strong>Actionscript to perform this task</strong></em>. There are already lots of videos up on web showing designers how to use the Flash IDE to do this..so here&#8217;s how to code it.</p>
<p>What our code will produce:</p>
<p> <img border='1' src="http://www.mathwarehouse.com/personal/images/txtlayout/subscript-superscript-pic.jpg" alt="" /></p>
<p>I have made several math based flash programs, and it has always been a pain in the butt to deal with exponents and subscripts. It has definitely been a long time coming&#8211;the ability to create sub and superscripts in a Flash. Now with the new TextLayout Framework you can do all sorts of things including subscripts!. I needed to learn how to do this for a new <a href="http://themathgames.com/">maths game </a>I was working on<a href="http://rjtherobot.com/"> Rj The Robot</a>-Since this was a math game, I needed to be able to write exponents in dynamic text fields&#8230;so let&#8217;s make some subscripts in Flash!</p>
<p><strong>Just Tell me the Steps</strong></p>
<p><strong>Step 1) </strong>Download The Text Layout Component here (<a href="http://labs.adobe.com/downloads/textlayout.html">http://labs.adobe.com/downloads/textlayout.html</a>) Note: do <strong>not </strong>install the &#8216;open source&#8217; version, go down the page a bit to get the &#8220;<em>text layout component</em>&#8220;<br />
<strong><br />
Step 2) </strong>use the Flash Extension Manager to install the  &#8220;Text Layout Flash Component.mxp&#8221; file&#8230;and then restart flash.</p>
<p><strong>Step 3) </strong>Open up a Flash File , then open up the components panel (window-&gt; components) and open up the &#8220;standard components&#8221; and drag an instance of the &#8220;textlayout&#8221; component onto the stage.   (After you have done this you can actually delete the component from the stage&#8230;we just needed to make sure the component was in our library&#8230;I assume you could also just drag the component directly to the library to achieve this )</p>
<p>Ok, now you can use all of the cool text layout features that we will need to be able to make a Subscript in Flash.</p>
<p><strong>Step 4)</strong>  Now a bit of Actionscript. I am not going to go over all of the details of how the Text Frame Work works(the two links below explain the framework in greater detail).</p>
<p><strong> Download the Source Code </strong> <a href="http://www.mathwarehouse.com/personal/coding/src/superscript-demo.zip">here</a></p>
<p><em>Good links on TextLayout</em><br />
<a href="http://livedocs.adobe.com/labs/textlayout/">Adobe Docs</a><br />
<a href="http://devgirl.wordpress.com/category/text-layout-framework/">link 1</a><br />
<a href="http://corlan.org/2009/01/19/how-to-use-text-layout-framework-in-flex-32-or-air-15/">link 2</a></p>
<p>Here&#8217;s the code for Main</p>
<p>package<br />
{<br />
import flash.display.LineScaleMode;<br />
import flash.display.Sprite;<br />
import flashx.textLayout.elements.ParagraphElement;<br />
import flashx.textLayout.elements.SpanElement;<br />
import flashx.textLayout.elements.TextFlow;<br />
import flashx.textLayout.formats.CharacterFormat;</p>
<p>import flash.display.DisplayObject;<br />
import fl.controls.TextLayout;</p>
<p>/* textLayout_flash is the base class for the Text Layout component. If you bring up the properties on the TextLayout Component in the library, you will see this.*/</p>
<p>public class MainTxt extends Sprite<br />
{</p>
<p>public function MainTxt()<br />
{</p>
<p>var myTextComponent:TextLayout;<br />
// Instantiate the textLayout_flash class to create a TextLayout Component.<br />
myTextComponent = new TextLayout();</p>
<p>// Add the new component to the Stage.<br />
var myTextComponentOnStage:DisplayObject = addChild(myTextComponent);<br />
// Get the Text Flow from the TextLayout Component.<br />
var textFlow:Object = myTextComponent.textFlow;<br />
var span0:SpanElement = textFlow.getFirstLeaf();<br />
span0.text = &#8220;E=MC&#8221;;</p>
<p>//get reference to &#8216;root&#8217; ParagraphElement of the TextFlow<br />
 var rootParagraphElement:ParagraphElement = textFlow.getChildAtIndex(0);</p>
<p>var span2:SpanElement = new SpanElement();<br />
span2.text =&#8221;2&#8243;;<br />
rootParagraphElement.addChild(span2);</p>
<p>var span3:SpanElement = new SpanElement();<br />
span3.text =&#8221;\n\nLog&#8221;;<br />
rootParagraphElement.addChild( span3 );</p>
<p>var span4:SpanElement = new SpanElement();<br />
span4.text =&#8221;2&#8243;;<br />
rootParagraphElement.addChild( span4);</p>
<p>var span5:SpanElement = new SpanElement();<br />
span5.text =&#8221; = 3&#8243;;<br />
rootParagraphElement.addChild( span5 );</p>
<p>var cf:CharacterFormat = new CharacterFormat(textFlow.characterFormat);<br />
cf.fontSize = 20;<br />
textFlow.characterFormat = cf;</p>
<p>var superScriptFormat:CharacterFormat = new CharacterFormat(textFlow.characterFormat);</p>
<p>superScriptFormat.baselineShift = flashx.textLayout.formats.BaselineShift.SUPERSCRIPT;<br />
span2.characterFormat = superScriptFormat;</p>
<p>var subScript:CharacterFormat = new CharacterFormat(textFlow.characterFormat);<br />
subScript.baselineShift = flashx.textLayout.formats.BaselineShift.SUBSCRIPT;<br />
span4.characterFormat = subScript;<br />
   }</p>
<p>}</p>
<p>} </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=160&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2010/06/05/actionscript-subscripts-with-flash-text-layout-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>

		<media:content url="http://www.mathwarehouse.com/personal/images/txtlayout/subscript-superscript-pic.jpg" medium="image" />
	</item>
		<item>
		<title>Box2d 2.1 b2world.QueryPoint() and iterating over a b2fixture list</title>
		<link>http://wwwebber.wordpress.com/2010/05/20/box2d-2-1-b2world-querypoint-and-iterating-over-a-b2fixture-list/</link>
		<comments>http://wwwebber.wordpress.com/2010/05/20/box2d-2-1-b2world-querypoint-and-iterating-over-a-b2fixture-list/#comments</comments>
		<pubDate>Thu, 20 May 2010 10:47:59 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[Box2d]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=152</guid>
		<description><![CDATA[In version 2.1 (and earlier I believe) of box2d objects are stored in linked lists. A common task will be iterate over one of these linked lists. For instance if you want to iterate over a body&#8217;s b2fixture linked list. In my case, I had the following problem: I was making a kids math game [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=152&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In version 2.1 (and earlier I believe) of box2d objects are stored in linked lists. A common task will be iterate over one of these linked lists. For instance if you want to iterate over a body&#8217;s b2fixture linked list. In my case, I had the following problem: I was making <a href="http://themathgames.com/">a kids math game</a>  on <a href="http://www.mathwarehouse.com/algebra/like-terms/how-to-combine-like-terms-in-math.php">how to combine like terms</a> called<a href="http://www.rjtherobot.com/"> Rj The Robot </a>, and I only wanted the robot to jump if it was standing on a &#8216;floor&#8217; shape. Now all &#8216;foors&#8217; in the game had a string attached to their b2fixture called &#8216;is_floor&#8217;. Below is some code that demonstrates how floor bodies, shapes and fixtures are creating. Note: if you don&#8217;t know what a b2fixture is<a href="http://www.box2dflash.org/docs/2.1a/updating"> read this.</a><br />
<code><br />
//bottom wall<br />
var bottom_wallShape:b2PolygonShape = new b2PolygonShape();<br />
var bottom_wallBd:b2BodyDef = new b2BodyDef();<br />
bottom_wallBd.type = b2Body.b2_staticBody;<br />
var bottom_wallBody:b2Body;<br />
bottom_wallBd.position.Set(halfOfStageWidth /PIXELS_PER_METER , halfOfStage*2/ PIXELS_PER_METER- .5 );<br />
bottom_wallShape.SetAsBox(ground_width, ground_height);<br />
bottom_wallBody = myB2World.CreateBody(bottom_wallBd); </code><br />
<code><br />
var fd:b2FixtureDef = new b2FixtureDef();<br />
fd.friction = 1 ;<br />
fd.shape = bottom_wallShape;<br />
fd.userData = 'is_floor';<br />
bottom_wallBody.CreateFixture(fd); </code><br />
<img src="http://www.mathwarehouse.com/personal/images/box2d/herofoot.jpg" alt="" /><br />
Now, I wanted the hero to be able to tell if it was standing on a shape whose b2fixture had the string &#8216;is_floor&#8217; as its userdata. The solution is to use the b2World.QueryPoint() function . This function takes the form of myb2World.QueryPoint(callbackFunction, someB2Vec) where the someB2Vec is the point to check.  In the picture below I was sending the red dot, called heroFootPoint in my code, to the function. Below is the full code explained in the comments<br />
<code>//get hero's center point<br />
var currentCenter:b2Vec2 = _body.GetWorldCenter();<br />
heroFootPoint.x = currentCenter.x<br />
heroFootPoint.y = currentCenter.y +  1.43    //add 1.43 so point is below Robot  foot;<br />
var bIsOnFloor:Boolean = false;             //assume not standing on floor<br />
</code></p>
<p>function bOnFloorFixture(fixture:b2Fixture):Boolean    //call back function<br />
{                                                                                                               //this call back function<br />
var body:b2Body =  b2Fixture(fixture).GetBody();            //get body of current fixture<br />
var bsFixture:b2Fixture = body.GetFixtureList();<br />
while (bsFixture != null )                                                                 //it<br />
{<br />
if (bsFixture.GetUserData() == &#8216;is_floor&#8217;)                  //found a fixture whose userdata is &#8216;is_floor&#8217;&#8230;ie are standing on the floor<br />
{<br />
bIsOnFloor = true;<br />
return false;                                                                           //return false so that we don&#8217;t continue iterating over the list<br />
}<br />
bsFixture = bsFixture.GetNext();                              //if we got here we didn&#8217;t yet find a fixture with &#8216;is_floor&#8217; userdat..</p>
<p>}                                                                                              //so see if body has another b2fixture attached for checking</p>
<p>return true;                                                                                    //callback returns true means that the queryWorld() function will check next b2Fixture at heroFootPoint<br />
}<br />
myB2World.QueryPoint(bOnFloorFixture, heroFootPoint);               //start queryPoint()&#8230;check all fixtures overlapping heroFootPoint</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=152&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2010/05/20/box2d-2-1-b2world-querypoint-and-iterating-over-a-b2fixture-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>

		<media:content url="http://www.mathwarehouse.com/personal/images/box2d/herofoot.jpg" medium="image" />
	</item>
		<item>
		<title>Upgrading to Box2D 2.1 (Flash)</title>
		<link>http://wwwebber.wordpress.com/2010/05/11/upgrading-to-box2d-2-1-flash/</link>
		<comments>http://wwwebber.wordpress.com/2010/05/11/upgrading-to-box2d-2-1-flash/#comments</comments>
		<pubDate>Tue, 11 May 2010 08:49:03 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=139</guid>
		<description><![CDATA[Box2d 2.1 offers several improvements in its use of events, its object models and added features like buoyancy, over 2.02 but you&#8217;ll find that none of your code compiles anymore. Read this post about fixtures Read this forum post about the new and improved contact listener 2.1 a documentation Other changes Version 2.02 Version 2.1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=139&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Box2d 2.1 offers several improvements in its use of events, its object models and added features like buoyancy,  over 2.02 but you&#8217;ll find that none of your code compiles anymore.</p>
<p>Read <a href="http://www.box2dflash.org/docs/2.1a/updating">this post about fixtures</a><br />
Read <a href="http://www.box2d.org/forum/viewtopic.php?f=8&amp;t=4668">this forum post about the new and improved contact listener</a><br />
<a href="http://www.box2dflash.org/docs/2.1a/reference/">2.1 a documentation</a><br />
Other changes</p>
<table border="1" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td>Version 2.02</td>
<td>Version 2.1</td>
</tr>
<tr>
<td>myB2body.WakeUp()</td>
<td>myB2Body.SetAwake(true)</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p><strong>Gone and Not Necessarily Missed</strong></p>
<ul>
<li>myB2Body.SetMassFromShapes() //apparently done automatically</li>
<li>declaring a size of your   B2World() . Create a world with new b2World(GRAVITY_VECTOR,  doSleep ) Notice the lack of a b2aab for the world size!</li>
</ul>
<p><strong>New and Very Welcome</strong></p>
<p>The new contactListner is vastly improved and would take a whole post in itself to explain, but it&#8217;s a very welcome improvement</p>
<p>I&#8217;ll add other small feature changes as I stumble upon them while working on my new <a href="http://www.rjtherobot.com/">kids game: RJ the Robot</a> ( math based platform game)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=139&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2010/05/11/upgrading-to-box2d-2-1-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>
	</item>
		<item>
		<title>Rectangle on top of line&#8230;rotated at any angle</title>
		<link>http://wwwebber.wordpress.com/2010/03/06/rectangle-on-top-of-line-rotated-at-any-angle/</link>
		<comments>http://wwwebber.wordpress.com/2010/03/06/rectangle-on-top-of-line-rotated-at-any-angle/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 19:07:34 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[game development]]></category>
		<category><![CDATA[trigonometry]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=134</guid>
		<description><![CDATA[Just started a new game and i needed to have a character who could &#8216;walk&#8217; on a line at any angle &#8230;even upside . With a little trig it&#8217;s fairly easy to place a rectanguler movieclip on top of a line. Here&#8217;s all the source code Here&#8217;s the critical code c1 and c2 are the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=134&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just started a new game and i needed to have a character who could &#8216;walk&#8217; on a line at any angle &#8230;even upside <a href="http://www.mathwarehouse.com/personal/coding/src/rectangle-to-vector/rectangle-to-vector.html"><img src="http://www.mathwarehouse.com/personal/coding/src/rectangle-to-vector/pic.png" alt="pic" /></a>  .<br />
<br />
With a little trig it&#8217;s fairly easy to place a rectanguler movieclip on top of a line.</p>
<p>Here&#8217;s all the <a href="http://www.mathwarehouse.com/personal/coding/src/rectangle-to-vector/rect-to-line.zip">source code</a></p>
<p>Here&#8217;s the critical code</p>
<p><code>c1 and c2 </code>are the endpoints of the line that you can drag around (<a href="http://www.mathwarehouse.com/personal/coding/src/rectangle-to-vector/rectangle-to-vector.html">demo</a>)<br />
<code>hero</code> is the name of my rectangular object<br />
<code>xOffset </code> is how far hero should move (based off left right arrow keys). Each time the key is pressed we add or subtract from this number. So it represents a &#8220;cumulative&#8221; and current x value.</p>
<p><code>//calculate angle of line based on endpoints</code><br />
<code>var angle:Number = Math.atan2(c2.y - c1.y, c2.x - c1.x);</code><br />
<code>//rotation of MovieClips in Flash is in degrees...so convert</code><br />
<code>hero.rotation = angle * 180 / Math.PI;</code><br />
//how far (dx) are we from first of the two points<code><br />
<code>var xFromOrigin:Number =  xOffset - c1.x;</code><br />
<code>//just some trig here</code><br />
<code>var newY:Number = c1.y + xFromOrigin * Math.tan( angle);</code><br />
<code>//get new coordinates of hero</code></p>
<p><code>hero.x = xOffset + h * Math.sin(angle)</code><br />
<code>hero.y = newY  - h * Math.cos(angle)</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/134/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=134&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2010/03/06/rectangle-on-top-of-line-rotated-at-any-angle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>

		<media:content url="http://www.mathwarehouse.com/personal/coding/src/rectangle-to-vector/pic.png" medium="image">
			<media:title type="html">pic</media:title>
		</media:content>
	</item>
		<item>
		<title>Meteor Based Blitter Engine</title>
		<link>http://wwwebber.wordpress.com/2010/02/21/meteor-based-blitter-engine/</link>
		<comments>http://wwwebber.wordpress.com/2010/02/21/meteor-based-blitter-engine/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 21:27:38 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[image effects]]></category>
		<category><![CDATA[bitmap blit]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=117</guid>
		<description><![CDATA[Following up on my last post on how to dynamically, scale and apply filters to display objects and then copy these into bitmapdatas , I wanted to implement the following Source Code 1) A Meteor class that pre calculates and precaches its rotation, scale etc.. into arrays (thus gaining a performance boost ) Again, I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=117&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Following up on my last post on how to <a href="http://wwwebber.wordpress.com/2010/02/21/actionscript-3-bitmapdata-how-to-apply-filter-scale-and-then-center-bitmapdata/">dynamically, scale and apply filters to display objects  and then copy these into bitmapdatas</a> , I wanted to implement the following<br />
<a href="http://www.mathwarehouse.com/personal/coding/src/meteors_2/"><img src="http://www.mathwarehouse.com/personal/coding/src/meteors_2/pic.png" alt=""> </a></p>
<p><a href="http://www.mathwarehouse.com/personal/coding/src/meteors_2/meteors_2.zip">Source Code</a></p>
<p>1) A <a href="http://www.mathwarehouse.com/personal/coding/src/meteors_2/MeteorSpawn.as">Meteor class </a>that pre calculates and precaches its rotation, scale etc.. into arrays (thus gaining a performance boost ) Again, I feel the need to give a link out to <a href="http://8bitrocket.com">8bitrocket.com</a> here regarding this entire idea of bitmapdata blitting for performance gains . Unlike the <a href="http://wwwebber.wordpress.com/2010/02/21/actionscript-3-bitmapdata-how-to-apply-filter-scale-and-then-center-bitmapdata/">last post</a>, this one would require also rotating the meteors (just a few extra lines)  and storing all of the rotations into an array (I&#8217;m actually using the new Vector class&#8230;but same idea) Here&#8217;s the <a href="http://www.mathwarehouse.com/personal/coding/src/meteors_2/MeteorSpawn.as">updated meteor class.</a><br />
2) Create a <a href="http://www.mathwarehouse.com/personal/coding/src/meteors_2/MeteorSpawnFactory.as">Meteor Manager class </a> (self descriptive) for adding new meteors etc..</p>
<p>It ended up working pretty well. Here&#8217;s about the only code you need in your main document class to get the meteors going </p>
<p><code>//create a bitmapdata --which our MetoerManager can blit to<br />
var canvas:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,false, 0x0000);<br />
//create a bitmap to house the bitmapdata<br />
var bmp = new Bitmap(canvas);<br />
stage.addChild(bmp);</p>
<p>//create the Manager object<br />
var mFact:MeteorSpawnFactory = MeteorSpawnFactory.getInstance();;<br />
//pre-cache the bitmapdata<br />
MeteorSpawn.preCache();</p>
<p>//let the manager know about the bitmapdata that it'll blit to<br />
mFact.canvas = super.canvas;</p>
<p>//"spawn" a new at x = 100 and y = 200<br />
mFact.addSpawn(100, 200);<br />
</code></p>
<p><a href="http://www.mathwarehouse.com/personal/coding/src/meteors_2/meteors_2.zip">Source Code</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=117&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2010/02/21/meteor-based-blitter-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>

		<media:content url="http://www.mathwarehouse.com/personal/coding/src/meteors_2/pic.png" medium="image" />
	</item>
		<item>
		<title>Actionscript 3: BitMapData&#8211;how to Dynamically Apply a filter, scale and then center BitmapData</title>
		<link>http://wwwebber.wordpress.com/2010/02/21/actionscript-3-bitmapdata-how-to-apply-filter-scale-and-then-center-bitmapdata/</link>
		<comments>http://wwwebber.wordpress.com/2010/02/21/actionscript-3-bitmapdata-how-to-apply-filter-scale-and-then-center-bitmapdata/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 13:30:20 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[image effects]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=94</guid>
		<description><![CDATA[Basically, if you are wondering how to create a new BitmapData by scaling a display object and also applying a filter and you would like to keep track of the new center of your scaled bitmapdata &#8230;this example is for you. Source cs3 . demo I was working on a new game for my online [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=94&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> <strong>Basically, if you are wondering how to create a new BitmapData by scaling a display object and also applying a filter and you would like to keep track of the new center of your scaled bitmapdata &#8230;this example is for you.</strong> </p>
<ul>
<li><a href="http://www.mathwarehouse.com/personal/coding/src/centerbitmapdata/bitmapdata.fla">Source</a> cs3 .</li>
<li><a href="http://www.mathwarehouse.com/personal/coding/src/centerbitmapdata/bitmapdata.html">demo </a></li>
</ul>
<p><a href="http://www.mathwarehouse.com/personal/coding/src/centerbitmapdata/bitmapdata.html"><br />
<img src="http://www.mathwarehouse.com/personal/coding/src/centerbitmapdata/pic.png" alt="" /></a></p>
<p>I was working on a new game for my <a href="http://themathgames.com/">online math games </a> site and I wanted to be able to  create a new BitmapData that was a scaled down version of a library item. This in itself is easy but it required a bit of extra to work to also be able to scale the display object dynamically as well as dynamically apply a filter , and all the while keep track of the center of the  &#8216;real object&#8217; (ie the radius of a original circular meteor).  Knowing the true center of the bitmapdata as well as the radius of the &#8216;real&#8217; object (ie not counting the filter) is necessary for doing collision testing in the <a href="http://themathgames.com">math game</a>.</p>
<p>I have attached a flash cs3 version of the file whose <a href="http://www.mathwarehouse.com/personal/coding/src/centerbitmapdata/bitmapdata.html">demo </a>you can see here and <a href="http://www.mathwarehouse.com/personal/coding/src/centerbitmapdata/bitmapdata.fla">download the cs3 file here</a>. As an aside, I hate using timeline code but I wanted to provide this example in a single file&#8230;so I put all the code in the main time line. The code does all of the work and places a red dot at the calculated center of the bitmap. This sort of stuff is useful in games that requiring blitting aka <a href="http://8bitrocket.com">8bitrocket.com </a>style</p>
<p>Pseudocde<br />
1) create instance of library item (in my case a meteor)<br />
2) Scale down or up the item<br />
3) apply filter around item<br />
4) create a new bitmapdata based on the size of the scaled meteor and the size of the filter (both dynamic)<br />
5) keep track of the &#8216;actual&#8217; radius of the scaled meteor (ie sans the filter) </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=94&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2010/02/21/actionscript-3-bitmapdata-how-to-apply-filter-scale-and-then-center-bitmapdata/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>

		<media:content url="http://www.mathwarehouse.com/personal/coding/src/centerbitmapdata/pic.png" medium="image" />
	</item>
		<item>
		<title>Php Script-Process, Display and Watermark all images in a Directory</title>
		<link>http://wwwebber.wordpress.com/2009/12/13/php-script-process-display-and-watermark-all-images-in-a-directory/</link>
		<comments>http://wwwebber.wordpress.com/2009/12/13/php-script-process-display-and-watermark-all-images-in-a-directory/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 13:22:10 +0000</pubDate>
		<dc:creator>wwwebber</dc:creator>
				<category><![CDATA[free php scripts]]></category>
		<category><![CDATA[image effects]]></category>

		<guid isPermaLink="false">http://wwwebber.wordpress.com/?p=77</guid>
		<description><![CDATA[I needed a bit of break from some large projects I&#8217;ve been working on so I made up a little script that will process, display and watermark all images in a directory. The script makes use of 2 classes. One class is a ImageViewer . This takes an image and watermerks it with whatever text [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=77&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I needed a bit of break from some large projects I&#8217;ve been working on so I made up a little script that will process, display and watermark all images in a directory. The script makes use of 2 classes. One class is a ImageViewer . This takes an image and watermerks it with whatever text you want.(font size and text is hard coded..so doesn&#8217;t work well for really small images&#8230;sorry just don&#8217;t have the time for that level of finesse at the moment)</p>
<p> The other class processes(DisplayImageDir) a directory by &#8211;it gets a list of all images in a given directory (anything with .jpg, .jpeg, .png, or .bmp) </p>
<p>The script will output a double columned display of all of the images in the directory with the watermark added!</p>
<p>You can <a href="http://www.mathwarehouse.com/code/php-scripts/imagewriter/imagewriter.zip">download the scirpt</a> </p>
<p>Here&#8217;s are some demo pages<br />
<a href="http://www.mathwarehouse.com/code/php-scripts/imagewriter/">http://www.mathwarehouse.com/code/php-scripts/imagewriter/</a><br />
<a href="http://www.mathwarehouse.com/algebra/linear_equation/images/">Images of Linear Equations</a></p>
<p>This script could definitely be improved and generalized. I simply wanted to make it easier for search engines and users of my site to be able to find, and if possibly download the many, many images I have over at Math Warehouse. However, I did want to ensure that there was a copyright watermark on each file.</p>
<p>The script works right out of the box, is open source and hopefully will be useful for someone.</p>
<p>This script ran on a Godaddy shared hosting account&#8211;about as budget as it gets so if you&#8217;re host doesn&#8217;t support the features for the script&#8230;it might be time for you to upgrade your account!</p>
<p>Also, note that I named one of the files <strong>.php5</strong> to ensure that it was processed by php 5&#8211;this was necessary on teh GoDaddy server&#8230;you might need to rename the file as well as teh associated variable which is located in DisplayImageDir.class.php</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wwwebber.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wwwebber.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wwwebber.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wwwebber.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wwwebber.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wwwebber.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wwwebber.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wwwebber.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wwwebber.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wwwebber.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wwwebber.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wwwebber.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wwwebber.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wwwebber.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wwwebber.wordpress.com&amp;blog=7899564&amp;post=77&amp;subd=wwwebber&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wwwebber.wordpress.com/2009/12/13/php-script-process-display-and-watermark-all-images-in-a-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08123987d04dcbdba13132ce3dc596e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wwwebber</media:title>
		</media:content>
	</item>
	</channel>
</rss>
