<?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>Adam Zwakk</title>
	<atom:link href="http://adamzwakk.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://adamzwakk.com</link>
	<description>Blog/Portfolio/Whatever.</description>
	<lastBuildDate>Tue, 07 Sep 2010 03:27:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Creative Donkeys</title>
		<link>http://adamzwakk.com/?p=371</link>
		<comments>http://adamzwakk.com/?p=371#comments</comments>
		<pubDate>Tue, 07 Sep 2010 03:27:34 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Portfolio Work]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe flash]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[portfolio]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=371</guid>
		<description><![CDATA[I am now working at Creative Donkeys as a Flash Developer. Woot?]]></description>
			<content:encoded><![CDATA[<p>I am now working at <a href="http://creativedonkeys.com/" target="_blank">Creative Donkeys</a> as a Flash Developer.</p>
<p>Woot?</p>
<!-- AdSense Now! V1.90 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-leadout" style="text-align:center;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-7534293235035565";
/* adamzwakk halfbanner */
google_ad_slot = "7526706654";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=371</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: Bus Stop Locator with Google Maps, AS3, and PHP</title>
		<link>http://adamzwakk.com/?p=343</link>
		<comments>http://adamzwakk.com/?p=343#comments</comments>
		<pubDate>Fri, 06 Aug 2010 16:16:38 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Portfolio Work]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[tutorial actionscript]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=343</guid>
		<description><![CDATA[For the past few days I&#8217;ve been messing around with the API that Google Maps put out for Flash. It lets you use Google maps in your own Flash/AIR applications and customize them however you want. I&#8217;m going to explain how to make your own AIR app that lets you display bus routes and stops [...]]]></description>
			<content:encoded><![CDATA[<p>For the past few days I&#8217;ve been messing around with the API that Google Maps put out for Flash. It lets you use Google maps in your own Flash/AIR applications and customize them however you want. I&#8217;m going to explain how to make your own AIR app that lets you display bus routes and stops using the Google Maps API and ZendAMF.</p>
<p>We&#8217;re also going to create a function that lets us see the approximate time the next bus will come to any given stop (ex. &#8220;5 minutes until the next bus&#8221;).</p>
<p><span id="more-343"></span></p>
<p>Some helpful links (be sure to read the Google Maps references and examples):</p>
<p><a href="http://code.google.com/apis/maps/documentation/flash/" target="_blank">Google Maps API/Libraries</a> (you&#8217;ll need an API key)</p>
<p><a href="http://framework.zend.com/download/amf" target="_blank">ZendAMF</a></p>
<p>For this example, I&#8217;m using the LTC of London Ontario with the 21/15 route, and the 17.</p>
<p>First we want to make a new &#8220;map&#8221; and we want a remote object that lets us communicate with PHP (I&#8217;m just generating XML here, see the source code for my example).</p>
<blockquote>
<div id="_mcePaste">&lt;maps:Map xmlns:maps=&#8221;com.google.maps.*&#8221; id=&#8221;map&#8221; mapevent_mapready=&#8221;onMapReady(event)&#8221; width=&#8221;100%&#8221; height=&#8221;100%&#8221;</div>
<div id="_mcePaste">url=&#8221;http://code.google.com/apis/maps/&#8221; key=&#8221;YOUR GOOGLE MAPS API KEY HERE&#8221;/&gt;</div>
<div id="_mcePaste">&lt;mx:RemoteObject id=&#8221;amfcall&#8221; destination=&#8221;LTC&#8221; source=&#8221;LTC&#8221; endpoint=&#8221;YOUR ZENDAMF URL HERE&#8221; showBusyCursor=&#8221;true&#8221; /&gt;</div>
</blockquote>
<div>Start a script tag and import all the libraries we&#8217;ll need.</div>
<div>
<blockquote>
<div>import com.google.maps.InfoWindowOptions;</div>
<div>import com.google.maps.LatLng;</div>
<div>import com.google.maps.Map;</div>
<div>import com.google.maps.MapEvent;</div>
<div>import com.google.maps.MapMouseEvent;</div>
<div>import com.google.maps.MapType;</div>
<div>import com.google.maps.controls.ZoomControl;</div>
<div>import com.google.maps.overlays.EncodedPolylineData;</div>
<div>import com.google.maps.overlays.Marker;</div>
<div>import com.google.maps.overlays.MarkerOptions;</div>
<div>import com.google.maps.overlays.Polyline;</div>
<div>import com.google.maps.overlays.PolylineOptions;</div>
<div>import com.google.maps.styles.FillStyle;</div>
<div>import com.google.maps.styles.StrokeStyle;</div>
<div><span style="white-space: pre;"> </span></div>
<div>import mx.collections.ArrayCollection;</div>
<div>import mx.controls.Alert;</div>
<div>import mx.rpc.AsyncResponder;</div>
<div>import mx.rpc.AsyncToken;</div>
<div>import mx.rpc.events.FaultEvent;</div>
<div>import mx.rpc.events.ResultEvent;</div>
</blockquote>
</div>
<div>As well as some variables we&#8217;re going to use later on (for all I know, I could define these in the actual functions, but I&#8217;m lazy and didn&#8217;t check)</div>
<div>
<blockquote>
<div>public var origmilliseconds:Number;</div>
<div><span style="white-space: pre;"> </span>public var dayString:String;</div>
<div><span style="white-space: pre;"> </span>public var content:String;</div>
<div><span style="white-space: pre;"> </span>public var weekDayLabels:Array = new Array(&#8220;Sun&#8221;,</div>
<div><span style="white-space: pre;"> </span>&#8220;Mon&#8221;,</div>
<div><span style="white-space: pre;"> </span>&#8220;Tue&#8221;,</div>
<div><span style="white-space: pre;"> </span>&#8220;Wed&#8221;,</div>
<div><span style="white-space: pre;"> </span>&#8220;Thu&#8221;,</div>
<div><span style="white-space: pre;"> </span>&#8220;Fri&#8221;,</div>
<div><span style="white-space: pre;"> </span>&#8220;Sat&#8221;);</div>
</blockquote>
</div>
<div>For our initial function, we&#8217;re going to center the map on London Ontario and create 3 buttons. One for each route, and one to clear all our map overlays. We&#8217;ll also add a Zoom Control (not needed, but I personally prefer it to using the mouse wheel to zoom)</div>
<div>
<blockquote>
<div>private function onMapReady(event:Event):void {</div>
<div><span style="white-space: pre;"> </span>this.map.addControl(new ZoomControl());</div>
<div><span style="white-space: pre;"> </span>this.map.setCenter(new LatLng(42.979398,-81.246138), 12, MapType.NORMAL_MAP_TYPE);</div>
<div><span style="white-space: pre;"> </span>createButton(&#8220;21/15&#8243;, 0, 0, function(event:Event):void { showTwentyOne(); });</div>
<div><span style="white-space: pre;"> </span>createButton(&#8220;17&#8243;, 100, 0, function(event:Event):void { showSevenTeen(); });</div>
<div><span style="white-space: pre;"> </span>createButton(&#8220;Clear&#8221;, 200, 0, function(event:Event):void { clearOverlays(); });</div>
<div>}</div>
</blockquote>
</div>
<p>And while we&#8217;re at it, we&#8217;ll make our Clear Overlay function since it&#8217;s really simple.</p>
<blockquote><p>private function clearOverlays():void{</p>
<p><span style="white-space: pre;"> </span>map.clearOverlays();</p>
<p><span style="white-space: pre;"> </span>}</p></blockquote>
<p>The next bit of code specifies how the buttons we just created will look. It&#8217;s pretty self explanatory (colors, size, position, etc.)</p>
<blockquote><p>private function createButton(text:String,x:Number,y:Number,callback:Function):void {</p>
<p><span style="white-space: pre;"> </span>var button:Sprite = new Sprite();</p>
<p><span style="white-space: pre;"> </span>button.x = x;</p>
<p><span style="white-space: pre;"> </span>button.y = y;</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>var label:TextField = new TextField();</p>
<p><span style="white-space: pre;"> </span>label.text = text;</p>
<p><span style="white-space: pre;"> </span>label.x = 2;</p>
<p><span style="white-space: pre;"> </span>label.selectable = false;</p>
<p><span style="white-space: pre;"> </span>label.autoSize = TextFieldAutoSize.CENTER;</p>
<p><span style="white-space: pre;"> </span>var format:TextFormat = new TextFormat(&#8220;Verdana&#8221;);</p>
<p><span style="white-space: pre;"> </span>label.setTextFormat(format);</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>var buttonWidth:Number = 100;</p>
<p><span style="white-space: pre;"> </span>var background:Shape = new Shape();</p>
<p><span style="white-space: pre;"> </span>background.graphics.beginFill(0xFFFFFF);</p>
<p><span style="white-space: pre;"> </span>background.graphics.lineStyle(1, 0&#215;000000);</p>
<p><span style="white-space: pre;"> </span>background.graphics.drawRoundRect(0, 0, buttonWidth, 18, 4);</p>
<p><span style="white-space: pre;"> </span>background.graphics.endFill();</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>button.addChild(background);</p>
<p><span style="white-space: pre;"> </span>button.addChild(label);</p>
<p><span style="white-space: pre;"> </span>button.addEventListener(MouseEvent.CLICK, callback);;</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>map.addChild(button);</p>
<p><span style="white-space: pre;"> </span>}</p></blockquote>
<p>Next we&#8217;ll define our route. Google Maps uses a <a href="http://code.google.com/apis/maps/documentation/utilities/polylinealgorithm.html" target="_blank">weird algorithm</a> to define waypoints and paths, but fortunately they made a tool to make them really easily and spit out the code you need <a href="http://code.google.com/apis/maps/documentation/utilities/polylineutility.html" target="_blank">here</a>. For the 21/15 route, this is the function/algorithm I used. (It gets a little wacky)</p>
<blockquote><p>private function showTwentyOne():void{</p>
<p><span style="white-space: pre;"> </span>//21 ROUTE START</p>
<p><span style="white-space: pre;"> </span>var twentyonePoints:String = &#8220;eiqeGnkunNeRebAtN{FsIyd@tDuWwSaCgHsAiBVe@{BgFlCiCpEcA~EuAhKrDdCnBhGlApGlBzBrBlLBnBu@~DxIxCfD?tEgAfa@jvBbd@{Pn|@n{E`cAia@d_@c@xh@sSxFpYtd@yQbEnTp@lc@bcAiG|@l[fGbyAlHs@bM`CjKgBxHnBpJcAzEiC|AdP}@jW?xQpA|[";</p>
<p><span style="white-space: pre;"> </span>var twentyoneLevels:String = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB";</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>var twentyonePolyline:Polyline = Polyline.fromEncoded(</p>
<p><span style="white-space: pre;"> </span>new EncodedPolylineData(twentyonePoints, 32, twentyoneLevels, 4),</p>
<p><span style="white-space: pre;"> </span>new PolylineOptions({ strokeStyle: new StrokeStyle({</p>
<p><span style="white-space: pre;"> </span>color: 0x0000ff,</p>
<p><span style="white-space: pre;"> </span>thickness: 4,</p>
<p><span style="white-space: pre;"> </span>alpha: 0.7})</p>
<p><span style="white-space: pre;"> </span>}));</p>
<p><span style="white-space: pre;"> </span>map.addOverlay(twentyonePolyline);</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>getStops(21);</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>}</p></blockquote>
<p>Then we'll run the "getStops" function that gets all out stops from the database and displays them as overlays on the map.</p>
<blockquote><p>private function getStops(route:Number):void{</p>
<p><span style="white-space: pre;"> </span>var tok:AsyncToken = amfcall.getStops(route);</p>
<p><span style="white-space: pre;"> </span>tok.addResponder(new AsyncResponder(getStopsWin, somethingfail, tok));</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>}</p></blockquote>
<p>Using <a href="http://adamzwakk.com/?p=159" target="_blank">AsyncToken</a>, we use PHP to generate the list of stops from the DB and bring them back as XML. Google Maps uses longitude and latitude so we'll be bring those coordinates back from the database.</p>
<blockquote><p>private function getStopsWin(event:ResultEvent, token:AsyncToken):void{</p>
<p><span style="white-space: pre;"> </span>var xml:XML = XML(event.result);</p>
<p><span style="white-space: pre;"> </span>var xmlList:XMLList;</p>
<p><span style="white-space: pre;"> </span>xmlList = xml.children();</p>
<p><span style="white-space: pre;"> </span>for(var i:int=0; i&lt;xmlList.length(); i++)</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>map.addOverlay(createStop(xmlList.stopID[i],new LatLng(xmlList.lat[i],xmlList.lang[i]),&#8221;"));</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>}</p>
<p>private function createStop(stopID:int, latlng:LatLng, content:String):Marker {</p>
<p><span style="white-space: pre;"> </span>var marker:Marker = new Marker(latlng);</p>
<p><span style="white-space: pre;"> </span>marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void {</p>
<p><span style="white-space: pre;"> </span>var tok:AsyncToken = amfcall.getTimes(stopID);</p>
<p><span style="white-space: pre;"> </span>tok.addResponder(new AsyncResponder(getTimesWin, somethingfail, tok));</p>
<p><span style="white-space: pre;"> </span>});</p>
<p><span style="white-space: pre;"> </span>return marker;</p>
<p><span style="white-space: pre;"> </span>}</p></blockquote>
<p>As an extra feature, we&#8217;re going to calculate the approximate time that the next bus will appear to any given stop we click on. For this, we use the <a href="http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/Date.html" target="_blank">Date functions</a> in AS3 to compare the current time with the bus times we have in the database for any given stop. I&#8217;m sure there is some easier way to compare times, but this is the way that works for me.</p>
<blockquote><p>private function closestTime(now:Number, after:Number):int{</p>
<p><span style="white-space: pre;"> </span>var difference:int = after &#8211; now;</p>
<p><span style="white-space: pre;"> </span>difference = difference/1000;</p>
<p><span style="white-space: pre;"> </span>difference = difference/60;<span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>return difference;</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>private function getTimesWin(event:ResultEvent, token:AsyncToken):void{</p>
<p><span style="white-space: pre;"> </span>var currentTime:Date = new Date();</p>
<p><span style="white-space: pre;"> </span>var currentMilliseconds:Number = currentTime.valueOf();</p>
<p><span style="white-space: pre;"> </span>var dayString:String = weekDayLabels[currentTime.getDay()];</p>
<p><span style="white-space: pre;"> </span>var xml:XML = XML(event.result);</p>
<p><span style="white-space: pre;"> </span>var xmlList:XMLList;</p>
<p><span style="white-space: pre;"> </span>xmlList = xml.children();</p>
<p><span style="white-space: pre;"> </span>for(var i:int=0; i&lt;xmlList.length(); i++)</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>var time:String = xmlList.time[i]+&#8221; GMT-0&#8243;+(currentTime.getTimezoneOffset()/60)+&#8221;00 &#8220;+dayString+&#8221; &#8220;+(currentTime.month+1)+&#8221;/&#8221;+(currentTime.getDate())+&#8221;/&#8221;+currentTime.getFullYear();</p>
<p><span style="white-space: pre;"> </span>var milliseconds:Number = Date.parse(time);</p>
<p><span style="white-space: pre;"> </span>var minutesleft:int = closestTime(currentMilliseconds,milliseconds);</p>
<p><span style="white-space: pre;"> </span>var latlng:LatLng = new LatLng(xmlList.lat[i],xmlList.lang[i]);</p>
<p><span style="white-space: pre;"> </span>if (i==0){</p>
<p><span style="white-space: pre;"> </span>var compareTime:int = minutesleft;</p>
<p><span style="white-space: pre;"> </span>} else {</p>
<p><span style="white-space: pre;"> </span>if(compareTime &gt; minutesleft || compareTime &lt; 0){</p>
<p><span style="white-space: pre;"> </span>compareTime = minutesleft;</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>if(compareTime == 1){</p>
<p><span style="white-space: pre;"> </span>content = compareTime+&#8221; minute left till the next bus&#8221;;</p>
<p><span style="white-space: pre;"> </span>} else if(compareTime == 0){</p>
<p><span style="white-space: pre;"> </span>content = &#8220;Bus should already be there!&#8221;;</p>
<p><span style="white-space: pre;"> </span>}else {</p>
<p><span style="white-space: pre;"> </span>content = compareTime+&#8221; minutes left till the next bus&#8221;;</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>var timeTitle:String = &#8220;Bus Stop&#8221;;</p>
<p><span style="white-space: pre;"> </span>map.openInfoWindow(latlng, new InfoWindowOptions({titleHTML: timeTitle, contentHTML: content}));</p>
<p><span style="white-space: pre;"> </span>}</p></blockquote>
<p>The only thing that&#8217;s left to do, is add a fail function in case the PHP or MySQL doesn&#8217;t work right.</p>
<blockquote><p>public function somethingfail(event:FaultEvent, token:AsyncToken):void{</p>
<p><span style="white-space: pre;"> </span>Alert.show(&#8220;Uh oh, something went wrong on our side! Try again in a bit!&#8221;);//OH GAWD</p>
<p><span style="white-space: pre;"> </span>}</p></blockquote>
<p><a href="http://adamzwakk.com/wp-content/uploads/2010/08/LTC_src.zip" target="_blank">Here&#8217;s the source files </a>which include all this AS3 source code, PHP, and a SQL dump of the database I used.</p>
<p>If you have any questions or comments, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=343</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>London Transit System App</title>
		<link>http://adamzwakk.com/?p=333</link>
		<comments>http://adamzwakk.com/?p=333#comments</comments>
		<pubDate>Sun, 25 Jul 2010 06:06:59 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Portfolio Work]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[adobe flash]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[bus]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[london ontario]]></category>
		<category><![CDATA[ltc]]></category>
		<category><![CDATA[ontario]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=333</guid>
		<description><![CDATA[I&#8217;ve started to make an LTC map synced with Google Maps so you can figure out if there is a bus near your position in London Ontario. Right now I have the 21/15 and 17 routes marked. It&#8217;s an AIR app, but I can easily port it to a SWF for use with Flash. Check [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started to make an LTC map synced with Google Maps so you can figure out if there is a bus near your position in London Ontario. Right now I have the 21/15 and 17 routes marked. It&#8217;s an AIR app, but I can easily port it to a SWF for use with Flash.</p>
<p><a href="http://adamzwakk.com/LTC.air" target="_blank">Check it out here.</a></p>
<p>Be warned, there are a few bugs.</p>
<p><a href="http://adamzwakk.com/wp-content/uploads/2010/07/timeLeft.jpg" rel="lightbox[333]"><img class="aligncenter size-medium wp-image-338" title="timeLeft" src="http://adamzwakk.com/wp-content/uploads/2010/07/timeLeft-300x122.jpg" alt="" width="300" height="122" /></a></p>
<p>Update: Now synced with a MySQL database to find when the next bus will come. (There are only a few stops in there, so if there are some REALLY huge times or it says &#8220;bus is already there&#8221;, I haven&#8217;t put the next time in yet.)</p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=333</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Since when did Windows do this?</title>
		<link>http://adamzwakk.com/?p=324</link>
		<comments>http://adamzwakk.com/?p=324#comments</comments>
		<pubDate>Sun, 18 Jul 2010 20:41:28 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[win7]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows7]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=324</guid>
		<description><![CDATA[It&#8217;s showing me what application the file is open in. When did MS add this? I&#8217;m always used to searching through the process list to find what app is using the file, or using Unlocker to &#8220;unlock&#8221; the file from whatever application.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s showing me what application the file is open in. When did MS add this? I&#8217;m always used to searching through the process list to find what app is using the file, or using <a href="http://ccollomb.free.fr/unlocker/" target="_blank">Unlocker</a> to &#8220;unlock&#8221; the file from whatever application.</p>
<p><span id="more-324"></span></p>
<p><a href="http://adamzwakk.com/wp-content/uploads/2010/07/fileopen.jpg" rel="lightbox[324]"><img class="alignnone size-medium wp-image-326" title="fileopen" src="http://adamzwakk.com/wp-content/uploads/2010/07/fileopen-300x187.jpg" alt="" width="300" height="187" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=324</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>johnny_ripper &#8211; exit pieces</title>
		<link>http://adamzwakk.com/?p=318</link>
		<comments>http://adamzwakk.com/?p=318#comments</comments>
		<pubDate>Thu, 08 Jul 2010 18:31:20 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[breaks]]></category>
		<category><![CDATA[dnb]]></category>
		<category><![CDATA[drum and bass]]></category>
		<category><![CDATA[electronic]]></category>
		<category><![CDATA[idm]]></category>
		<category><![CDATA[johnny_ripper]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=318</guid>
		<description><![CDATA[johnny_ripper is a electronic artist from France that also worked on the nin.com community&#8217;s Phantom Project. He just released his new EP &#8220;Exit Pieces&#8221; and some of the beats and ideas he uses are really inspiring. With his permission, I&#8217;m hosting the album here. Download You can also visit his Facebook page here.]]></description>
			<content:encoded><![CDATA[<p>johnny_ripper is a electronic artist from France that also worked on the <a href="http://adamzwakk.com/?p=65" target="_blank">nin.com community&#8217;s Phantom Project</a>. He just released his new EP &#8220;Exit Pieces&#8221; and some of the beats and ideas he uses are really inspiring.</p>
<p>With his permission, I&#8217;m hosting the album here.</p>
<p><a href="http://www.adamzwakk.com/johnny_ripper_exit_pieces.zip" target="_blank">Download</a></p>
<p>You can also visit his Facebook page <a href="http://www.facebook.com/pages/johnny_ripper/110354659111?ref=ts" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=318</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Feeling Remains (Remix)</title>
		<link>http://adamzwakk.com/?p=310</link>
		<comments>http://adamzwakk.com/?p=310#comments</comments>
		<pubDate>Tue, 06 Jul 2010 06:17:39 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[bass]]></category>
		<category><![CDATA[contest]]></category>
		<category><![CDATA[deconbrio]]></category>
		<category><![CDATA[fixt]]></category>
		<category><![CDATA[fixt remix]]></category>
		<category><![CDATA[remix]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=310</guid>
		<description><![CDATA[I made this remix for the Deconbrio Fixt Remix contest. I might do another one of the same song before the contest is over. Author insert a music with WS Audio Player.(Download) this music. Comment and rate on the contest site: http://bit.ly/cq5ZT8]]></description>
			<content:encoded><![CDATA[<p>I made this remix for the Deconbrio Fixt Remix contest. I might do another one of the same song before the contest is over.</p>
<p><span id="more-310"></span><br /><img src="http://adamzwakk.com/wp-content/plugins/ws-audio-player/img/music.gif" alt="music" />Author insert a music with <a href="http://icyleaf.com/projects/ws-audio-player/">WS Audio Player</a>.<br />(<a href="http://adamzwakk.com/wp-content/uploads/2010/07/thefeelingremains_otheroutro.mp3" />Download</a>) this music.</p>
<p>Comment and rate on the contest site: <a href="http://bit.ly/cq5ZT8" target="_blank">http://bit.ly/cq5ZT8</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=310</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://adamzwakk.com/wp-content/uploads/2010/07/thefeelingremains_otheroutro.mp3" length="5483275" type="audio/mpeg" />
		</item>
		<item>
		<title>Uncommunicative Clients</title>
		<link>http://adamzwakk.com/?p=292</link>
		<comments>http://adamzwakk.com/?p=292#comments</comments>
		<pubDate>Fri, 02 Jul 2010 23:07:32 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Update]]></category>
		<category><![CDATA[clients]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[rage]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=292</guid>
		<description><![CDATA[How do you deal with clients that don&#8217;t communicate? Recently I&#8217;ve had a couple clients that flat out didn&#8217;t respond to any of my emails. They would ask questions about WordPress, how they could do certain functions, etc. and I would tell them the solution in the best way that I could, and I get [...]]]></description>
			<content:encoded><![CDATA[<p>How do you deal with clients that don&#8217;t communicate? Recently I&#8217;ve had a couple clients that flat out didn&#8217;t respond to any of my emails. They would ask questions about WordPress, how they could do certain functions, etc. and I would tell them the solution in the best way that I could, and I get no response. No, it wasn&#8217;t due to the email not going through or anything, they flat out just didn&#8217;t get back to me on whether they had success or not.</p>
<p><span id="more-292"></span></p>
<p>So suddenly, it&#8217;s my fault that I didn&#8217;t *poke* them respond back to me when I was just doing my job with tech support, and they just didn&#8217;t get back to me because they didn&#8217;t understand. Of course they complained to my supervisor and told him &#8220;my site doesn&#8217;t work&#8221; or &#8220;why doesn&#8217;t this work yet&#8221; when I gave them easy fixes and instructions for the issues they wanted to solve. They just didn&#8217;t read or follow them.</p>
<p>Do all clients act this way? Or am I in some sort of twilight zone where people don&#8217;t respond to eachother when they need help?</p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=292</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raging Nerds</title>
		<link>http://adamzwakk.com/?p=274</link>
		<comments>http://adamzwakk.com/?p=274#comments</comments>
		<pubDate>Wed, 23 Jun 2010 20:27:52 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[ps3]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[xbox 360]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=274</guid>
		<description><![CDATA[I just thought I&#8217;d plug this. I&#8217;m hosting and administering this gaming related site. They have a bunch of E3 coverage and alot of great plans for the future. Check it out. ﻿﻿http://www.ragingnerds.com]]></description>
			<content:encoded><![CDATA[<p>I just thought I&#8217;d plug this. I&#8217;m hosting and administering this gaming related site. They have a bunch of E3 coverage and alot of great plans for the future.</p>
<p>Check it out.</p>
<p><a href="http://www.ragingnerds.com" target="_blank">﻿﻿http://www.ragingnerds.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=274</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Old Lucasarts Games</title>
		<link>http://adamzwakk.com/?p=258</link>
		<comments>http://adamzwakk.com/?p=258#comments</comments>
		<pubDate>Mon, 14 Jun 2010 03:09:12 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Gaming]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=258</guid>
		<description><![CDATA[I found copies of Day of the Tentacle, and Sam n Max. Complete with manuals and semi-scratched disks.]]></description>
			<content:encoded><![CDATA[<p>I found copies of Day of the Tentacle, and Sam n Max. Complete with manuals and semi-scratched disks.</p>
<p><span id="more-258"></span><a href="http://adamzwakk.com/wp-content/uploads/2010/06/HPIM0485.jpg" rel="lightbox[258]"><img class="alignnone size-medium wp-image-259" title="HPIM0485" src="http://adamzwakk.com/wp-content/uploads/2010/06/HPIM0485-300x225.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=258</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: as3isolib game with Mario RPG sprites and pathfinding</title>
		<link>http://adamzwakk.com/?p=244</link>
		<comments>http://adamzwakk.com/?p=244#comments</comments>
		<pubDate>Tue, 18 May 2010 20:40:05 +0000</pubDate>
		<dc:creator>Adam Zwakenberg</dc:creator>
				<category><![CDATA[Portfolio Work]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe flash]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[as3isolib]]></category>
		<category><![CDATA[astar]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[tutorial actionscript]]></category>
		<category><![CDATA[tweener]]></category>

		<guid isPermaLink="false">http://adamzwakk.com/?p=244</guid>
		<description><![CDATA[I&#8217;ve been working with as3isolib for quite some time now and since I can&#8217;t find many tutorials on how to do things, here&#8217;s a somewhat simple one to create a terrain with a mario sprite (loaded from an external SWF) to walk around in. You can view the finished product and the source code here [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with as3isolib for quite some time now and since I can&#8217;t find many tutorials on how to do things, here&#8217;s a somewhat simple one to create a terrain with a mario sprite (loaded from an external SWF) to walk around in.</p>
<p>You can view the finished product and the source code <a href="http://adamzwakk.com/mario/pathfindingtest.swf" target="_blank">here</a> (right click to view source).</p>
<p><span id="more-244"></span>First, make sure you import all the classes you will need.</p>
<blockquote><p>import as3isolib.display.IsoSprite;</p>
<p>import as3isolib.display.IsoView;</p>
<p>import as3isolib.display.scene.IsoScene;</p>
<p>import bit101.AStar;</p>
<p>import bit101.Grid;</p>
<p>import bit101.Node;</p>
<p>import caurina.transitions.*;</p>
<p>import com.adobe.viewsource.ViewSource;</p>
<p>import eDpLib.events.ProxyEvent;</p>
<p>import flash.display.Loader;</p>
<p>import flash.display.Sprite;</p>
<p>import flash.display.StageAlign;</p>
<p>import flash.display.StageScaleMode;</p>
<p>import flash.events.*;</p>
<p>import flash.net.URLRequest;</p></blockquote>
<p>This uses an AStar class that I got from <a href="papervision2.com/papervision-isometric-view-pathfinding-using-as3isolib-and-a-a-star/" target="_blank">Papervision2</a>. (In fact, this is a heavily modified version of that code)</p>
<p>Next we define our class, and create all the variables we will be using.</p>
<blockquote><p>public class pathfindingtest extends Sprite<br />
{<br />
protected var cellSize:int = 50;//size of cubes/squares<br />
protected var pathGrid:Grid;<br />
protected var path:Array;<br />
protected var isoView:IsoView;<br />
protected var isoScene:IsoScene;<br />
protected var dude:IsoSprite = new IsoSprite;<br />
protected var speed:Number = 0.4;<br />
protected var speed1:Number;<br />
protected var delay:Number;<br />
protected var delayfix:Number = 0;;<br />
protected var speedcheck:Boolean = false;<br />
protected var _numX:Number = 0;<br />
protected var _numY:Number = 0;<br />
protected var targetX:Number;<br />
protected var targetY:Number;<br />
protected var dudeDir:String;<br />
protected var leftRightTempX:Number = 0;<br />
protected var leftRightTempY:Number = 0;</p>
<p>private var loaderMario:Loader;<br />
private var loaderGrass:Loader;</p></blockquote>
<p>For our main function, we want to load the External SWFs we have for both Mario and the terrain. When they complete, we want to create our random terrain.</p>
<blockquote><p>public function pathfindingtest(){<br />
loaderMario = new Loader();<br />
loaderMario.load(new URLRequest(&#8220;mario.swf&#8221;));<br />
loaderGrass = new Loader();<br />
loaderGrass.contentLoaderInfo.addEventListener(Event.INIT,makeGrid);<br />
loaderGrass.load(new URLRequest(&#8220;grassSprites.swf&#8221;));<br />
}</p></blockquote>
<p>For our grid, we&#8217;re going to make a 10&#215;10 grid with random obstacles every time the page loads. We also want to create an Event Listener on every frame that renders the IsoScene for us and updates Mario on his direction.</p>
<blockquote><p>protected function makeGrid(e:Event):void<br />
{<br />
addEventListener(Event.ENTER_FRAME, render);<br />
pathGrid = new Grid(10, 10);//makes a 10&#215;10 grid<br />
for(var i:int = 0; i &lt; 15; i++)<br />
{<br />
pathGrid.setWalkable(Math.floor(Math.random() * 8 ) + 2,<br />
Math.floor(Math.random() * 8)+ 2,<br />
false);//randomly selects which tiles will be up or down<br />
}<br />
drawGrid();<br />
}</p></blockquote>
<p>Now we want to draw the grid, and place all the objects on our scene. We also want to randomize the terrain a bit so there will be small differences in grass and obstacles (4 different grass sprites, and 4 different obstacle sprites). On every grass sprite, we&#8217;ll make an event listener that will be our walking function (so we cannot click on an obstacle) Then we want to add it all to the IsoScene and then add the IsoScene to the IsoView so we can see all our sprites.</p>
<blockquote><p>protected function drawGrid():void<br />
{<br />
isoScene 		= new IsoScene();<br />
isoView 		= new IsoView();</p>
<p>isoView.clipContent = false;</p>
<p>var grassClass:Class = loaderGrass.contentLoaderInfo.applicationDomain.getDefinition(&#8220;Grass&#8221;) as Class;<br />
var grass2Class:Class = loaderGrass.contentLoaderInfo.applicationDomain.getDefinition(&#8220;Grass2&#8243;) as Class;<br />
var grass3Class:Class = loaderGrass.contentLoaderInfo.applicationDomain.getDefinition(&#8220;Grass3&#8243;) as Class;<br />
var grass4Class:Class = loaderGrass.contentLoaderInfo.applicationDomain.getDefinition(&#8220;Grass4&#8243;) as Class;</p>
<p>var blockClass:Class = loaderGrass.contentLoaderInfo.applicationDomain.getDefinition(&#8220;Block&#8221;) as Class;<br />
var block2Class:Class = loaderGrass.contentLoaderInfo.applicationDomain.getDefinition(&#8220;Block2&#8243;) as Class;<br />
var block3Class:Class = loaderGrass.contentLoaderInfo.applicationDomain.getDefinition(&#8220;Block3&#8243;) as Class;<br />
var block4Class:Class = loaderGrass.contentLoaderInfo.applicationDomain.getDefinition(&#8220;Block4&#8243;) as Class;</p>
<p>for(var i:int = 0; i &lt; pathGrid.numCols; i++)<br />
{<br />
for(var j:int = 0; j &lt; pathGrid.numRows; j++)//go through each column, and then each row<br />
{<br />
var node:Node = pathGrid.getNode(i, j);//grab the current node (or square) of the grid<br />
var ground:IsoSprite = new IsoSprite();</p>
<p>if (node.walkable)//if it was determined that the tile is down, it makes the height 0 and adds an event listener<br />
{<br />
var grassPicker:int = Math.random()*4+1;<br />
if(grassPicker == 1){<br />
ground.sprites = [grassClass];<br />
} else if (grassPicker == 2){<br />
ground.sprites = [grass2Class];<br />
} else if (grassPicker == 3){<br />
ground.sprites = [grass3Class];<br />
} else if (grassPicker == 4){<br />
ground.sprites = [grass4Class];<br />
}</p>
<p>ground.addEventListener(MouseEvent.CLICK, onGridItemClick);<br />
}<br />
else<br />
{<br />
var blockPicker:int = Math.random()*4+1;<br />
if(grassPicker == 1){<br />
ground.sprites = [blockClass];<br />
} else if (grassPicker == 2){<br />
ground.sprites = [block2Class];<br />
} else if (grassPicker == 3){<br />
ground.sprites = [block3Class];<br />
} else if (grassPicker == 4){<br />
ground.sprites = [block4Class];<br />
}<br />
}<br />
ground.moveTo(i * cellSize, j * cellSize, 0);//places the box<br />
isoScene.addChild(ground);<br />
}<br />
}</p>
<p>//Set properties for isoView<br />
isoView.setSize(stage.stageWidth, stage.stageHeight);<br />
isoView.showBorder = false;<br />
dude.isAnimated = true;<br />
dude.autoUpdate = true;</p>
<p>isoView.autoUpdate = true;</p>
<p>isoScene.addChild(dude);</p>
<p>//Add the isoScene to the isoView<br />
isoView.addScene(isoScene);</p>
<p>//Add the isoView to the stage<br />
addChild(isoView);<br />
}</p></blockquote>
<p>Next, we&#8217;ll create our function that runs when we click on a grass tile. We want it to grab where we clicked, and where Mario is right now.</p>
<blockquote><p>protected function onGridItemClick(evt:ProxyEvent):void<br />
{<br />
var box:IsoSprite = evt.target as IsoSprite;</p>
<p>//Get and set End Nodes (where are we going)<br />
var xpos:int = (box.x)/cellSize;<br />
var ypos:int = Math.floor(box.y / cellSize);//grabs the center of what the player just clicked<br />
pathGrid.setEndNode(xpos,ypos);</p>
<p>//Get and set Start Node (where are we now)<br />
xpos = Math.floor(dude.x / cellSize);<br />
ypos = Math.floor(dude.y / cellSize);</p>
<p>pathGrid.setStartNode(xpos, ypos);//grabs the position of the dude</p>
<p>//Find our path<br />
findPath();<br />
}</p></blockquote>
<p>So now that we have out start and end points, we need to find the path to get there and plot a waypoint system (it gets a bit complicated here). For every point, we want to tween Mario so he goes through all the points. This works using the Tweener Delay system. We add a delay after every point. That way his start and end point will match up perfectly. I&#8217;ve also added a fix here which makes Mario move a bit slower when he goes directly left or right. This is because the regular tween between left and right goes about 125% faster than the rest of the tweens.</p>
<blockquote><p>protected function findPath():void<br />
{<br />
var astar:AStar = new AStar();</p>
<p>if(astar.findPath(pathGrid))//if there is a path between the two nodes&#8230;<br />
{<br />
path = astar.path;//make our path using a waypoint system</p>
<p>for (var i:int = 1; i &lt; path.length; i++) 				{ 					//trace(path[i].x+&#8217;,'+path[i].y); 					targetX = path[i].x * cellSize; 					targetY = (path[i].y * cellSize);//for every spot on our waypoint, tween it through every point					 					speedcheck = checkTween(targetX, targetY); 					moveDude(targetX, targetY, i); 					//trace(targetX+&#8217;,'+targetY); 					 				} 				speed1=0; 				delay = 0; 				delayfix = 0; 				speedcheck=null; 			} else { 				//if path is impossible, do something here. add a text message maybe? 			} 			 		} 		 		public function moveDude(targetX:Number, targetY:Number, i:int):void{ 				if(i &gt; 1){<br />
speed1 = speed;<br />
}<br />
//trace(speed1);<br />
if(speedcheck == true){<br />
speed = 0.65;<br />
if(speed1 == 0.4){<br />
delay = speed1;//finds out how much delay is needed from the last instruction<br />
Tweener.addTween(dude, {x:targetX, y:targetY, delay:delay+delayfix , time:speed, transition:&#8221;linear&#8221;} );//tween the dude<br />
Tweener.addTween(isoView, {x:((-targetX+targetY)/2)*2, y:(-targetY-targetX)/2, delay:delay+delayfix , time:speed, transition:&#8221;linear&#8221; } );//tween the camera<br />
delayfix = delayfix+delay;//adds to the total delay time so the tweens stack on another<br />
} else {<br />
delay = speed;//finds out how much delay is needed from the current instruction<br />
Tweener.addTween(dude, {x:targetX, y:targetY, delay:delay+delayfix , time:speed, transition:&#8221;linear&#8221;} );//tween the dude<br />
Tweener.addTween(isoView, {x:((-targetX+targetY)/2)*2, y:(-targetY-targetX)/2, delay:delay+delayfix , time:speed, transition:&#8221;linear&#8221; } );//tween the camera<br />
delayfix = delayfix+delay;//adds to the total delay time so the tweens stack on another<br />
}<br />
} else if(speedcheck == false) {<br />
speed = 0.4;<br />
if(speed1 == 0.65){<br />
delay = speed1;//finds out how much delay is needed from the last instruction<br />
Tweener.addTween(dude, {x:targetX, y:targetY, delay:delay+delayfix , time:speed, transition:&#8221;linear&#8221;} );//tween the dude<br />
Tweener.addTween(isoView, {x:((-targetX+targetY)/2)*2, y:(-targetY-targetX)/2, delay:delay+delayfix , time:speed, transition:&#8221;linear&#8221; } ); //tween the camera<br />
delayfix = delayfix+delay;//adds to the total delay time so the tweens stack on another<br />
} else {<br />
delay = speed;//finds out how much delay is needed from the current instruction<br />
Tweener.addTween(dude, {x:targetX, y:targetY, delay:delay+delayfix , time:speed, transition:&#8221;linear&#8221;} );//tween the dude<br />
Tweener.addTween(isoView, {x:((-targetX+targetY)/2)*2, y:(-targetY-targetX)/2, delay:delay+delayfix , time:speed, transition:&#8221;linear&#8221; } ); //tween the camera<br />
delayfix = delayfix+delay;//adds to the total delay time so the tweens stack on another<br />
}</p>
<p>}<br />
//trace(i+&#8217;: Speed:&#8217;+speed+&#8217; Delay:&#8217;+delayfix);//This trace would find the number of tweens happening at one time and their speeds and delays<br />
}</p>
<p>//CHECKS IF DUDE IS GOING LEFT OR RIGHT(HE MOVES SLIGHTLY FASTER IN BOTH THOSE DIRECTIONS)<br />
public function checkTween(leftrightX:Number, leftrightY:Number):Boolean{<br />
if (leftrightX &lt; leftRightTempX &amp;&amp; leftrightY &gt; leftRightTempY) {<br />
leftRightTempX = leftrightX;<br />
leftRightTempY = leftrightY;<br />
//trace(&#8220;left&#8221;);<br />
return true;<br />
}else if (leftrightX &gt; leftRightTempX &amp;&amp; leftrightY &lt; leftRightTempY) {<br />
leftRightTempX = leftrightX;<br />
leftRightTempY = leftrightY;<br />
//trace(&#8220;right&#8221;);<br />
return true;<br />
} else {<br />
leftRightTempX = leftrightX;<br />
leftRightTempY = leftrightY;<br />
//trace(&#8220;regular&#8221;);<br />
return false;<br />
}<br />
}</p></blockquote>
<p>Almost done, now all we have to do is have it check which direction Mario is going, and change his sprite accordingly on every frame. We load all his sprites from the external SWF (just like the terrain ones) and add them to Mario accordingly.</p>
<blockquote><p>public function checkDude():void{<br />
var marioFrontClass:Class = loaderMario.contentLoaderInfo.applicationDomain.getDefinition(&#8220;MarioFront&#8221;) as Class;<br />
var marioBackLeftClass:Class = loaderMario.contentLoaderInfo.applicationDomain.getDefinition(&#8220;MarioBackLeft&#8221;) as Class;<br />
var marioBottomRightClass:Class = loaderMario.contentLoaderInfo.applicationDomain.getDefinition(&#8220;MarioBottomRight&#8221;) as Class;<br />
var marioBackClass:Class = loaderMario.contentLoaderInfo.applicationDomain.getDefinition(&#8220;MarioBack&#8221;) as Class;<br />
var marioLeftClass:Class = loaderMario.contentLoaderInfo.applicationDomain.getDefinition(&#8220;MarioLeft&#8221;) as Class;<br />
var marioRightClass:Class = loaderMario.contentLoaderInfo.applicationDomain.getDefinition(&#8220;MarioRight&#8221;) as Class;<br />
var marioTopRightClass:Class = loaderMario.contentLoaderInfo.applicationDomain.getDefinition(&#8220;MarioTopRight&#8221;) as Class;<br />
var marioBottomLeftClass:Class = loaderMario.contentLoaderInfo.applicationDomain.getDefinition(&#8220;MarioBottomLeft&#8221;) as Class;<br />
if(_numX == 0 &amp;&amp; _numY == 0){<br />
_numX = dude.x;<br />
_numY = dude.y;<br />
if(dude.sprites.toString() != marioFrontClass.toString()){<br />
dude.sprites = [marioFrontClass];<br />
}<br />
}else {<br />
if (dude.x &lt; _numX) {<br />
if(dude.y &lt; _numY){ 						if(dude.sprites.toString() != marioBackClass.toString()){ 							dude.sprites = [marioBackClass]; 							dudeDir = &#8220;Up&#8221;; 						} 					} else if(dude.y &gt; _numY){<br />
if(dude.sprites.toString() != marioLeftClass.toString()){<br />
dude.sprites = [marioLeftClass];<br />
dudeDir = &#8220;Left&#8221;;<br />
}<br />
}else {<br />
if(dude.sprites.toString() != marioBackLeftClass.toString()){<br />
dude.sprites = [marioBackLeftClass];<br />
dudeDir = &#8220;UpLeft&#8221;;<br />
}<br />
}<br />
} else if (dude.x &gt; _numX) {<br />
if(dude.y &lt; _numY){ 						if(dude.sprites.toString() != marioRightClass.toString()){ 							dude.sprites = [marioRightClass]; 							dudeDir = &#8220;Right&#8221;; 						} 					} else if(dude.y &gt; _numY){<br />
if(dude.sprites.toString() != marioFrontClass.toString()){<br />
dude.sprites = [marioFrontClass];<br />
dudeDir = &#8220;Down&#8221;;<br />
}<br />
}else {<br />
if(dude.sprites.toString() != marioBottomRightClass.toString()){<br />
dude.sprites = [marioBottomRightClass];<br />
dudeDir = &#8220;DownRight&#8221;;<br />
}<br />
}<br />
} else {<br />
if(dude.y &lt; _numY){ 						if(dude.sprites.toString() != marioTopRightClass.toString()){ 							dude.sprites = [marioTopRightClass]; 							dudeDir = &#8220;UpRight&#8221;; 						} 					} else if(dude.y &gt; _numY){<br />
if(dude.sprites.toString() != marioBottomLeftClass.toString()){<br />
dude.sprites = [marioBottomLeftClass];<br />
dudeDir = &#8220;DownLeft&#8221;;<br />
}<br />
}<br />
}<br />
if(dude.x == _numX &amp;&amp; dude.y == _numY){<br />
dude.sprites = [marioFrontClass];//Mario faces forwards when stopped<br />
}<br />
_numX = dude.x;<br />
_numY = dude.y;<br />
}<br />
}</p></blockquote>
<p>And last, we&#8217;ll make our render function that runs every frame that renders the scene and checks for Mario to change direction.</p>
<blockquote><p>protected function render(event:Event = null):void<br />
{<br />
//Render the isoScene<br />
isoScene.render();<br />
checkDude();//Checks the sprite for direction change and changes the sprite accordingly<br />
}</p></blockquote>
<p>After everything, it should look something like <a href="http://adamzwakk.com/mario/srcview/index.html" target="_blank">this</a>.</p>
<p>Hope this helps anyone get a hold of as3isolib.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamzwakk.com/?feed=rss2&amp;p=244</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
