<?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>sevenson.com.au &#187; Programming</title>
	<atom:link href="http://www.sevenson.com.au/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sevenson.com.au</link>
	<description>The online presence of Andrew Sevenson</description>
	<lastBuildDate>Fri, 06 Aug 2010 12:40:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Jay Jays Jayvatar Builder Goes Live</title>
		<link>http://www.sevenson.com.au/ramblings/jay-jays-jayvatar-builder-goes-live/</link>
		<comments>http://www.sevenson.com.au/ramblings/jay-jays-jayvatar-builder-goes-live/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 12:44:24 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Jazz]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=458</guid>
		<description><![CDATA[This week the Jay Jays Jayvatar Builder that Visual Jazz created went live. It&#8217;s a cool little tool that lets you create your own custom avatar for use on the Jay Jays site. Whith a very unique style and heaps of options you are sure to create some very cooky characters. This first release consists [...]]]></description>
			<content:encoded><![CDATA[<p>This week the <a href="http://www.jayjays.com.au" title="Check out the Jayvatar Builder on the Jay Jays site">Jay Jays</a> Jayvatar Builder that <a href="http://www.visualjazz.com.au" title="Check out the Visual Jazz site after you finish reading here">Visual Jazz</a> created went live.  It&#8217;s a cool little tool that lets you create your own custom avatar for use on the Jay Jays site.</p>
<p>Whith a very unique style and heaps of options you are sure to create some very cooky characters.</p>
<p><span id="more-458"></span></p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/26/Editor.png"><img src="http://www.sevenson.com.au/content/uploads/2010/02/26/Editor-300x211.png" alt="Screen shot of the Jayvatars Editor Page" title="Jayvatars Editor Page" width="300" height="211" class="alignleft size-medium wp-image-459" /></a>This first release consists mostly of the Jayvatar builder, which is where you can create your custom jayvatar by combining any of the various pieces of clothing and accessories.  You can also choose between male and female body types, as well as different attributes, such as height, weight and arm length.  </p>
<p>There is even a &#8216;random&#8217; button for the less visually creative that generates a random jayvatar automatically.</p>
<p>Once you have completed creating you Jayvatar, you can save it and share it via facebook, twitter and email.  You can also save a version onto your computer for whatever reason you have in mind.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/26/Playground.png"><img src="http://www.sevenson.com.au/content/uploads/2010/02/26/Playground-300x212.png" alt="Screenshot of the Beta Jayvatars Playground" title="Jayvatars Playground" width="300" height="212" class="alignleft size-medium wp-image-462" /></a>You can also play around with your Jayvatar in the Javatar Playground.<br/> Here you can make your Jayvatarcan fly around the screen, bump items, crash down, etc.</p>
<p>At the moment the playground is just a Beta version so there is only a limited amount of interactivity happening.  There full release will allow you to do a lot more.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/Jayvatars.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/Jayvatars.jpg" alt="Some random javatars" title="Jayvatars" width="600" height="277" class="alignnone size-full wp-image-479" /></a></p>
<p>As a bonus, those people from Australia and New Zealand that sign up soon will be given a free $10 voucher to spend in store&#8230; BONUS! </p>
<p>So what are you waiting for?  Head over to the <a href="http://www.jayjays.com.au" title="Check out the Jayvatar Builder on the Jay Jays site">Jay Jays</a> site and create your own..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/ramblings/jay-jays-jayvatar-builder-goes-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enviromaniac Games</title>
		<link>http://www.sevenson.com.au/showcase/enviromaniac-games/</link>
		<comments>http://www.sevenson.com.au/showcase/enviromaniac-games/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 11:31:28 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[Online Showcase]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Jazz]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=374</guid>
		<description><![CDATA[A few months back, Visual Jazz (the place I work) was building a new site for Visy called Visy Enviromaniacs. The purpose of the site was to help educate children about the environment, teaching them about recycling, saving energy, etc. To help make the learning for fun and keep the kids interested, a major section [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/icon.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/icon.jpg" alt="Icon for the Enviromaniacs showcase" title="Enviromaniacs Icon" width="250" height="190" class="alignright size-full wp-image-481" /></a>A few months back, <a href="http://www.visualjazz.com.au" target="_blank">Visual Jazz</a> (the place I work) was building a new site for Visy called <a href="http://www.visyenviromaniacs.com.au/" target="_blank">Visy Enviromaniacs</a>.  The purpose of the site was to help educate children about the environment, teaching them about recycling,  saving energy, etc.</p>
<p>To help make the learning for fun and keep the kids interested, a major section of the site was a series of mini games with a planet saving theme.  It was my job to build those games&#8230;  I love my job <img src='http://www.sevenson.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Read on to hear about the games, and then check them out at <a href="http://www.visyenviromaniacs.com.au/" target="_blank">VISY Enviromaniacs</a>.<br />
<span id="more-374"></span><br />
<a href="http://www.sevenson.com.au/content/uploads/2010/02/home.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/home-300x191.jpg" alt="Home Screen of Environmaniacs" title="Home Screen of Environmaniacs" width="300" height="191" class="alignleft size-medium wp-image-482" /></a> Each of the games had a different theme, focussing on different ways to save the environment.  To keep things interesting, we made sure that the games were also different in the way that they played.  We didn&#8217;t one to have 5 of the same game with just a graphics changed.</p>
<p>As always, deadlines were tight, but the managers and designers that I worked with were right on top of things, so it all ended up falling into place.</p>
<p>Here is a quick run through of what we made:</p>
<hr/>
<h2>Recycle Frenzy</h2>
<p><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/frenzy1.jpg" alt="Recycle Frenzy Title Screen" title="Recycle Frenzy Title Screen" width="345" height="318" class="alignright" /><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/frenzy2.jpg" alt="Recycle Frenzy Screen Shot" title="Recycle Frenzy Screen Shot" width="345" height="318"  class="alignright" /></p>
<p>Recycle Frenzy was the first game we made.  It was a bit of across between Bejeweled, Tetris and a sorting game.  Pieces of litter would be added to the bottom of the screen, one row at a time.  The player would have to drag the pieces of litter the appropriate bin &#8211; general waste, recycling, paper or green waste. </p>
<p>If the rubbish made it all the way to the top of the screen, the game was over.</p>
<p>To add a bit of spice to the game, the player could swap the positions of litter by dragging them around the grid.  Arranging litter into larger groups before dragging it to the bin would result in bonus points being added to the score.  </p>
<p>Also, by filling up the bins the user unlocked &#8216;power ups&#8217; that allowed them to do things like remove an entire row or column with a single click.</p>
<p>Keeping with the tradition with these types of games, the speed would gradually increase as the game went on, causing for some very frantic game play &#8211; hence the &#8216;frenzy&#8217; part <img src='http://www.sevenson.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr/>
<h2>Energise the Earth</h2>
<p><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/energy1.jpg" alt="Energise the Earth Intro" title="Energise the Earth Intro" width="345" height="318"   class="alignleft" /><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/energy2.jpg" alt="Energise the Earth Screen Shot" title="Energise the Earth Screen Shot" width="345" height="318"  class="alignleft" /><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/energy3.jpg" alt="Energise the Earth Screen Shot" title="Energise the Earth Screen Shot" width="345" height="318"  class="alignleft" /></p>
<p>Energise the Earth is a bit of a strange game.  It is a very simple concept, but proved to be a bit harder to build then initially thought.</p>
<p>The basic idea of the game is to collect the energy that is escaping from appliances around the house.  As you look around the room, &#8216;energy tokens&#8217; will jump out from different appliances and you have to roll your mouse over them to collect them.</p>
<p>Each room you enter has a specified number of energy tokens you have to collect to successfully pass the room.  If you reach that amount, you move onto the next room. If you don&#8217;t, it is game over.</p>
<p>There are 5 rooms in total, including the living room, study, kitchen, laundry and bedroom.  If you pass all of the rooms, you start again, but with higher umber of tokens required in each of the rooms.</p>
<p>It is surprising frantic and keeping up with the pace can be quite stressful.  Good luck! <img src='http://www.sevenson.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr/>
<h2>Wild About Water</h2>
<p><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/water1.jpg" alt="Wild About Water Intro" title="Wild About Water Intro" width="345" height="318"  class="alignleft" /><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/water2.jpg" alt="Wild About Water Screen Shot" title="Wild About Water Screen Shot" width="345" height="318"  class="alignleft" /></p>
<p>Wild About Water was the second game I had to build.  This one was a bit more complex and confusing, but one you get the hang of it, it is quite addictive and satisfying.</p>
<p>The idea behind it is that you have to keep on top of all the possible water wasting events that occur around a house.  Everything from fixing dripping taps to covering swimming pools to prevent evaporation.  When something goes wrong, you are alerted and given an amount of time to fix the problem.  The longer you take to fix the problem, the more water you will lose.  If you run out of water, the game is over.</p>
<p>It&#8217;s not all bad though.  When you fix a problem, you are given the chance to collect that water with your bucket, adding to your overall water total.</p>
<p>If that wasn&#8217;t enough though, there are a couple of side tasks you have to keep in mind. Firstly, you have to keep the plants alive by giving them some of your water at regular intervals. Secondly, you have to drag dishes to the dish washer and clothes to the washing machine, making sure that the machines are full before they start so that you don&#8217;t waste water.</p>
<p>As I write this, it does sound overly complex, but like I said at the start, once you get used to it, it does prove to be a challenge.</p>
<hr/>
<h2>Bitter About Litter</h2>
<p><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/litter1.jpg" alt="Bitter About Litter Intro" title="Bitter About Litter Intro" width="345" height="318" class="alignright" /><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/litter2.jpg" alt="Bitter About Litter Screen Shot" title="Bitter About Litter Screen Shot" width="345" height="318" class="alignright" /></p>
<p>Bitter about Litter is all about collecting and sorting litter.    Sounds like fun, I know, but the game does go a long way to making it so.</p>
<p>You control a guy, in a park full of litterers.  As they drop throw their litter on the ground, you run over and pick it up.  You then bring it back to your bins where you quickly sort it into either waste or recycling.</p>
<p>When there is litter on the ground, your health begins to drop.  The more litter that is there, the faster your health will drop.  When you put rubbish int the bins, you get a bit of your health back &#8211; as long as it is going into the right bin.  When your health runs out, the game is over.</p>
<p>To add some more interest to the game, the player is awarded bonus points for sorting items of rubbish into the the bins without making mistakes.  There are also bonus points for returning with as much rubbish as you can carry.</p>
<p>Another nice feature we slotted into the game is that the character in the game actually takes on the look of the player&#8217;s &#8216;enviromaniac&#8217; avatar.  A small thing I know, but still pretty cool.</p>
<hr/>
<h2>Pick Your Packets</h2>
<p><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/packets1.jpg" alt="Pick Your Packets Intro" title=" Pick Your Packets Intro" width="345" height="318" class="alignright"" /><img src="http://www.sevenson.com.au/content/showcase/enviromaniacs/packets2.jpg" alt="Pick Your Packets Screen Shot" title="Pick Your Packets Screen Shot" width="345" height="318" class="alignright" /></p>
<p>Pick Your Packets is all about learning and identifying the different packaging types you may encounter in the super market.  </p>
<p>The player is given the task of sorting the various products into either good or bad packaging types.  Good items get scanned and added to the shopping basket, bad items get returned to the store.  To help them out, when ever they pick up a product a small description is displayed on the check-out display.</p>
<p>As the game goes on, the items on the conveyor begin to come out more rapidly. If the player is not fast enough, the products will begin to back up, causing the players health to drop.  If the health reaches 0, the game is over.</p>
<hr/>
<p>Thats pretty much it so far.  If you are interested in checking them out just head over to the <a href="http://www.visyenviromaniacs.com.au/" target="_blank">VISY Enviromaniac</a> site.  Also, big Kudos to the team at <a href="http://www.visualjazz.com.au/" target="_blank">Visual Jazz</a> who I work with.  They did an awesome job on building the site.  You can read a bit about it on the VJ site <a href="http://www.visualjazz.com.au/#/portfolio/enviromaniacs" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/showcase/enviromaniac-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Bakery</title>
		<link>http://www.sevenson.com.au/showcase/virtual-bakery/</link>
		<comments>http://www.sevenson.com.au/showcase/virtual-bakery/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 11:29:48 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[Online Showcase]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Jazz]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=383</guid>
		<description><![CDATA[Sometimes in this line of work someone gives you a job that is nothing but fun. Visual Jazz was rebuilding the entire Baker&#8217;s Delight website, and as a bit of a side project we were given the task of building a virtual bakery in Flash. The bakery was to be a high gloss virtual representation [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/icon2.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/icon2.jpg" alt="" title="Bakers Delight Icon" width="250" height="190" class="alignright size-full wp-image-492" /></a>Sometimes in this line of work someone gives you a job that is nothing but fun.</p>
<p><a href="http://www.visualjazz.com.au/" target="_blank">Visual Jazz</a> was rebuilding the entire Baker&#8217;s Delight website, and as a bit of a side project we were given the task of building a virtual bakery in Flash.  The bakery was to be a high gloss virtual representation of one of their stores, allowing visitors to browse through a sample selection of their products.</p>
<p>It was a simple project with a pretty cool looking result. Read on to find out some of the features, and then check it out at <a href="http://www.bakersdelight.com.au/virtual.html" target="_blank">http://www.bakersdelight.com.au/virtual.html</a>.</p>
<p><span id="more-383"></span></p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/loader.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/loader-300x191.jpg" alt="" title="Bakers Delight Virtual Breadstore Preloader" width="300" height="191" class="alignleft size-medium wp-image-493" /></a>Going through in a chronological order, the site starts off with a steaming loaf of bread.  The loading progress of the site is spelled out in the steam coming off of the bread.  This neat little trick was created using DisplacementMap filters in Flash.  It was a pretty simple trick, once I learned out displacement maps actually worked.<br clear="both"/><br />
<a href="http://www.sevenson.com.au/content/uploads/2010/02/store.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/store-300x191.jpg" alt="" title="Bakers Delight Virtual Breadstore Store Front" width="300" height="191" class="alignright size-medium wp-image-495" /></a><a href="http://www.sevenson.com.au/content/uploads/2010/02/range.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/range-300x191.jpg" alt="" title="Bakers Delight Virtual Breadstore Category" width="300" height="191" class="alignright size-medium wp-image-494" /></a>After that, the user is presented with the store front.  All of the different categories are laid out on display in the store.  The store was set up such a way that it panned and distorted based on mouse movement, giving the slight feeling that you were looking around a store.  It is a very subtle effect, but took some careful cutting out of graphics to make it work without looking like a room made of rubber.</p>
<p>A staff member is situated in the store holding up different promotional signs.  These signs can be easily swapped out for different promotions, and linked to any external pages required.</p>
<p>As an extra subtle little thing &#8211; if you look closely at the counter you will see that it reflects the mouse along its curved surface.  This again was created via the use of displacement maps.</p>
<p>When the user clicks on a category, the camera zooms in on the staff member, who holds up a board displaying all of the products.  The products are displayed in a traditional paged grid system.  Nothing too fancy going on here &#8211; but it does look pretty clean. </p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/detail.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/detail-300x191.jpg" alt="Bakers Delight Virtual Breadstore Product Detail" title="Bakers Delight Virtual Breadstore Product Detail" width="300" height="191" class="alignleft size-medium wp-image-491" /></a>When a product is selected, the grid collapses down to a single line so that the details of the product can be displayed.  This looks like a simple enough effect, but getting this grid to figure out how it should collapse and expand proved to be one of the most difficult tasks on this site.</p>
<p>The detail view of the product displayed the usual information you would expect.  The cool, and possibly over the top, part of this page was that some of the products were shot in a 360 degree fashion, allowing the user to spin/rotate the product around so it could be seen from any side.</p>
<p>That about sums it up.  I love it when I get to work on projects like this <img src='http://www.sevenson.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You can check out the entire new Baker&#8217;s Delight website at <a href="http://www.bakersdelight.com.au/" target="_blank">http://www.bakersdelight.com.au/</a>.  You can also read about the project over at the <a href="http://www.visualjazz.com.au/#/portfolio/bakers" target="_blank">Visual Jazz</a> site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/showcase/virtual-bakery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liv Doll Microsite</title>
		<link>http://www.sevenson.com.au/showcase/liv-doll-microsite/</link>
		<comments>http://www.sevenson.com.au/showcase/liv-doll-microsite/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 11:26:29 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[Online Showcase]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Augmented Reality]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Papervision 3D]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Jazz]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=387</guid>
		<description><![CDATA[Working at Visual Jazz does expose me to some interesting scenarios/ I mean, playing with dolls for a couple of weeks isn&#8217;t my usual idea of a good time, but this funky little microsite had some pretty cool features that had my brain ticking over the whole time. Some interesting 3D modelling and animation coupled [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/icon3.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/icon3.jpg" alt="Liv Doll Microsite Icon" title="Liv Doll Microsite Icon" width="250" height="190" class="alignright size-full wp-image-500" /></a>Working at <a href="http://www.visualjazz.com.au/" target="_blank">Visual Jazz</a> does expose me to some interesting scenarios/  I mean, playing with dolls for a couple of weeks isn&#8217;t my usual idea of a good time, but this funky little microsite had some pretty cool features that had my brain ticking over the whole time.</p>
<p>Some interesting 3D modelling and animation coupled with my first attempt augmented reality in flash made for some puzzling times.  Drench all that in a healthy dose of girly-ness and you get <a href="http://www.livinmyworld.com.au/" target="_blank">www.livinmyworld.com.au</a>.</p>
<p>Read on to find out more some of the more nerdy details <img src='http://www.sevenson.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-387"></span></p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/home2.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/home2-300x191.jpg" alt="Liv Doll Microsite" title="Liv Doll Microsite" width="300" height="191" class="alignleft size-medium wp-image-499" /></a>The idea behind the Liv doll site was to invite visitors to try out some of the different clothing accessories on a 3D version of a doll.  Once they have found a look that they are happy with they can use a webcam and augmented reality to take a photo of themselves posing with the doll.  This photo can then be saved, printed or sent on to their friends.</p>
<p>My job as the ActionScripter was to take all the designs, models and animations and make it all work.  Easy peasy&#8230; sort of.</p>
<p>The base of the site was pretty simple. It followed a basic page structure using on lots of flat colours, shading and bouncy transitions to help bring the site to life. Overall it was a very &#8216;happy&#8217; site and I had a lot of fun putting it together.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/dress.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/dress-300x191.jpg" alt="Liv Doll 3D Dress-up" title="Liv Doll 3D Dress-up" width="300" height="191" class="alignright size-medium wp-image-497" /></a>The tricky stuff started with the 3D.  Papervison was my weapon of choice. Mostly because I had used it before, but also because we hit some early snags with Away3D and I didn&#8217;t have time to try and resolve them.</p>
<p>Because we were allowing the user to change the hair, top and pants on the 3D model, each part had to be imported separately.  The 3D guy had loads of fun generating the different clothes, animating them, and then splitting them up for me.</p>
<p>These split up files meant that I needed to create a way to manage the loading of models and the related textures.  That was easy enough, but  part way through the process we noticed that some of the model combinations resulted in clipping.  This didn&#8217;t look very good and actually had an impact on the performance.</p>
<p>I discovered that if I applied an alpha channel to the offending model&#8217;s texture, the clipping went away and the performance improved (Sounds strange right?  Adding transparency made it run better?  Go figure). With this in mind I created a data management object which would load the required models and textures, then figure out what masking was required to make it all look good.</p>
<p>Sounds easy when I write it like that, but it actually got quite complex.  I basically had to write a matrix that would look at what clothes you were matching up, load the required textures, then merge the alpha channel with the textures before finally applying it to the model.</p>
<p>Next big thing was the animation of the models.  Not that playing the animation was hard, but keeping all the models in sync as they were swapped around was.  The animation controls in PaperVision weren&#8217;t the greatest for what I needed to do so I ended up using the <a href="http://code.google.com/p/daeanim/" target="_blank">DAE MC2</a> classes.  They allowed me to treat the animations a bit more like a MovieClip, so it was a lot easier to keep everything in sync.</p>
<p>The final big hurdle was the Augmented Reality (AR).  For this I used the awesome <a href="http://www.libspark.org/wiki/saqoosha/FLARToolKit/en" target="_blank">FLAR ToolKit</a> for this.  Unfortunately, a lot of the docs were in Japanese, so I ended up hunting down a tutorial/example over at <a href="http://www.mikkoh.com/blog/?p=182" target="_blank">Mikko Haapoja&#8217;s Blog</a>.  This got me up and running in no time.  </p>
<p>Out of the box it didn&#8217;t perform as well as I would have liked, so I spent a bit of time tweaking the code to make it run better.  Nothing too spectacular, just simple things like shrinking the size of the webcam image to reduce the number of calculations required and only calculating &#8216;every other&#8217; frame.</p>
<p>Another little tweak I did was to apply a basic &#8216;ease&#8217; to the model position.  This helped smooth out the little motions that the camera picked up and helped make AR feel much more responsive.</p>
<p>That&#8217;s about it.</p>
<p>Overall I am extremely happy with the site.  The designers and 3D modellers I work with at <a href="http://www.visualjazz.com.au/" target="_blank">Visual Jazz</a> did an awesome job of building the assets and despite the technical difficulties I mentioned above, it all came together well in the end.</p>
<p>If you haven&#8217;t checked it out already, go have a look at it <a href="http://www.livinmyworld.com.au/" target="_blank">here</a>.  You can also read a bit about it on the <a href="http://www.visualjazz.com.au/#/portfolio/livinmyworld" target="_blank">VJ Site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/showcase/liv-doll-microsite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colorado Microsite</title>
		<link>http://www.sevenson.com.au/showcase/colorado-microsite/</link>
		<comments>http://www.sevenson.com.au/showcase/colorado-microsite/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 11:28:58 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[Online Showcase]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Jazz]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=385</guid>
		<description><![CDATA[Colorado is tough at work and at play. Thats the idea behind this microsite that I helped build at Visual Jazz. The whole thing was built in flash and oozed manliness from start to finish. It was my job to do all the flash programming to make this site come to life. Read on to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/icon4.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/icon4.jpg" alt="" title="Colorado Icon" width="250" height="190" class="alignright size-full wp-image-506" /></a>Colorado is tough at work and at play.  Thats the idea behind this microsite that I helped build at <a href="http://www.visualjazz.com.au/">Visual Jazz</a>. The whole thing was built in flash and oozed manliness from start to finish.</p>
<p>It was my job to do all the flash programming to make this site come to life.</p>
<p>Read on to hear me ramble on a bit more about some of the details.</p>
<p><span id="more-385"></span></p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/ColoradoHome.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/ColoradoHome-300x191.jpg" alt="" title="Colorado Home Page" width="300" height="191" class="alignleft size-medium wp-image-503" /></a>The main base for the site was split into two different sides.  One side was the rough and tough &#8216;work&#8217; side, full of rough, dark, industrial areas.  The other side was the brighter &#8216;play&#8217; side with a much more fun feel.</p>
<p><br clear="both"/><br />
<a href="http://www.sevenson.com.au/content/uploads/2010/02/coloradoWorkHard.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/coloradoWorkHard-300x191.jpg" alt="" title="Colorado Work Hard" width="300" height="191" class="alignright size-medium wp-image-505" /></a>Different sections of the site were related to either work or play.  When a section was navigated to the entire background would pan left or right using a pretty cool parallax effect, with all the elements moving at slightly different speeds.  To help give a bit of atmosphere, I did some quick little animation effects.  These included some random floating clouds the work their way across the screen, as well as a random flock of birds that can occasionally be seen flying in the background.</p>
<p>Page elements animated into place using quick, almost &#8216;bouncy&#8217; motions, tweaked slightly to make the elements feel as though they had some weight to them. The panel that is used to display second level information is a very good example of this, as is falls into place like a heavy bit of steel.</p>
<p>I set up the base code for the buttons in such a way that the designers could easily create custom animation effects.  Examples of these can be seen throughout the site, as every major button tends to have a unique animation applied.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/Colorado360.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/Colorado360-300x191.jpg" alt="Colorado 360" title="Colorado 360" width="300" height="191" class="alignleft size-medium wp-image-502" /></a>One particular page of note was the accessories page which used a series of photographs to generate a 360 degree view of the vehicle.  As the user drags the vehicle around, different features come into view, allowing more information to be displayed.  I wish I could say that this was done using some fancy coding, but it is actually a carefully laid out timeline animation controlled via some code.</p>
<p>Full credit has to go to the designer for this site.  The rough &#8216;manly&#8217; feel of the site really worked well, and the elements he gave me to work with made my job a pleasure.</p>
<p>Although it was created a while ago, it is still a pretty cool site and can be checked out at <a href="http://www.holdencampaign.com.au/colorado/#/home/" target="_blank">http://www.holdencampaign.com.au/colorado/</a>.  You can also read about the project over at the <a href="http://www.visualjazz.com.au/#/portfolio/colorado" target="_blank">Visual Jazz</a> site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/showcase/colorado-microsite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DisplacementMapFilter Tester</title>
		<link>http://www.sevenson.com.au/actionscript/displacementmapfilter-tester/</link>
		<comments>http://www.sevenson.com.au/actionscript/displacementmapfilter-tester/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 04:54:09 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=389</guid>
		<description><![CDATA[Recently I did some work on the a project that required me to use some Displacement Maps. I have never used them before, but after playing with them for a bit I soon realised something&#8230; they are very awesome. They do take a little bit of getting used to, so to help with the experimentation [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2009/09/icon.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/09/icon.jpg" alt="" title="Displacement Tester Icon" width="250" height="139" class="alignright size-full wp-image-518" /></a>Recently I did some work on the a project that required me to use some Displacement Maps.  I have never used them before, but after playing with them for a bit I soon realised something&#8230; they are very awesome.</p>
<p>They do take a little bit of getting used to, so to help with the experimentation I created this little app that makes it easy to test out different image and maps combinations.</p>
<p><span id="more-389"></span></p>
<p><a href="http://www.sevenson.com.au/content/uploads/2009/09/screengrab.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/09/screengrab-300x166.jpg" alt="" title="DisplacementMap Tester Screen Grab" width="300" height="166" class="alignleft size-medium wp-image-521" /></a>The app lets you load in your own images (or use some of my defaults), adjust all the displacement settings and see the final result. It also generates ActionScript 3 code you will need to re-create the effect in your own project.</p>
<p><button id="displacementBtn" rel="#dispmappopup" type="button">Check out DisplacementMap Tester</button></p>
<div class="overlay" id="dispmappopup" style="width:910px;height:510px;background-image:url(http://www.sevenson.com.au/content/actionscript/displacement/largepopupbg.png);">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_swfloader_561510523"
			class="flashmovie"
			width="900"
			height="500">
	<param name="movie" value="http://www.sevenson.com.au/content/common/swfloader.swf" />
	<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/displacement/dispmaptest.swf&amp;clickToLoad=false&amp;corners=all" />
	<param name="quality" value="high" />
	<param name="wmode" value="window" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.sevenson.com.au/content/common/swfloader.swf"
			name="fm_swfloader_561510523"
			width="900"
			height="500">
		<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/displacement/dispmaptest.swf&amp;clickToLoad=false&amp;corners=all" />
		<param name="quality" value="high" />
		<param name="wmode" value="window" />
	<!--<![endif]-->
		
<div class="missingFlash">There should be a flash movie here?</div>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object></div>
<p>Now, I was going to attempt and explain what a Displacement Map is and how it all works, but I realised that there are already a bunch of resources out that that can do a better job than me.  One in particular that I found quite helpful was this <a href="http://www.emanueleferonato.com/2007/12/03/understanding-flash-displacement-map-filter/" target="_blank">article</a> written by Emanuele Feronato.  Most of it is written in AS2, but the concepts are still the same.</p>
<h3>Update</h3>
<p>I recently created a quick AIR version of this tester so that you don&#8217;t need a net connection to test custom images.  Its not anything fancy.  Just a direct port of this web version, but with local file read access.  </p>
<p>You can download the AIR version here: <a href="http://www.sevenson.com.au/wp-content/plugins/download-monitor/download.php?id=6" title="Downloaded 102 times">Displacement Map Tester (Air Verion)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/actionscript/displacementmapfilter-tester/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Regular Expressions in ActionScript 3</title>
		<link>http://www.sevenson.com.au/actionscript/testing-regular-expressions/</link>
		<comments>http://www.sevenson.com.au/actionscript/testing-regular-expressions/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 10:21:17 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=368</guid>
		<description><![CDATA[I&#8217;m by no means an expert on Regular Expressions. I mean, I get what they do, and can see their awesomeness, but damn they do my head in sometimes. To help myself out, I wrote a quick little Flex app that lets you test how a regular expression will work with a particular string. It [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2009/09/icon2.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/09/icon2.jpg" alt="" title="Regular Expression Icon" width="250" height="190" class="alignright size-full wp-image-540" /></a>I&#8217;m by no means an expert on Regular Expressions.  I mean, I get what they do, and can see their awesomeness, but damn they do my head in sometimes.</p>
<p>To help myself out, I wrote a quick little Flex app that lets you test how a regular expression will work with a particular string.  It lets you try out all the Flash Regular Expression methods and see each of the results.</p>
<p>To top it all off, I put together a quick overview of the different Flash Regular Expression methods that are available, as well as a short overview of the Regular Expression syntax.</p>
<p>You can check it all out right here&#8230;</p>
<p><span id="more-368"></span><br />
<a name="flashdemo"></a>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_swfloader_201425347"
			class="flashmovie"
			width="650"
			height="400">
	<param name="movie" value="http://www.sevenson.com.au/content/common/swfloader.swf" />
	<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/regexp/regexp.swf&amp;previewURL=http://www.sevenson.com.au/content/actionscript/regexp/preview.jpg&amp;clickToLoad=true&amp;corners=''" />
	<param name="quality" value="high" />
	<param name="wmode" value="transparent" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.sevenson.com.au/content/common/swfloader.swf"
			name="fm_swfloader_201425347"
			width="650"
			height="400">
		<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/regexp/regexp.swf&amp;previewURL=http://www.sevenson.com.au/content/actionscript/regexp/preview.jpg&amp;clickToLoad=true&amp;corners=''" />
		<param name="quality" value="high" />
		<param name="wmode" value="transparent" />
	<!--<![endif]-->
		
<div class="missingFlash">Flash should be here somewhere?</div>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Hope that helps you out!</p>
<h2 id="regexpmethods">Regular Expression Methods</h2>
<p>Here is are the Regular Expression methods that are used in AS3</p>
<hr/>
<h4>RegExp.test(string:String):Boolean</h4>
<p>Simply tests to see if the pattern is matched anywhere in the string</p>
<ul>
<li>if &#8216;g&#8217; flag is set it searches from the .lastIndex, and also sets it after each .test()</li>
<li>if &#8216;g&#8217; is not set, then the search is always done from the start</li>
</ul>
<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/RegExp.html#test()" title="ActionScript Language Reference - RegExp.test()">Click here</a> for the official documentation</p>
<hr/>
<h4>RegExp.exec(string:String):Object</h4>
<p>Returns an object with with various properties relating to the pattern. The properties are</p>
<ul>
<li>[0],[1] etc &#8211; Array like access &#8211; [pattern, group1, group2]</li>
<li>index &#8211; position of the match</li>
<li>input &#8211; the string that was tested</li>
</ul>
<p>If there is no match then this will return null.</p>
<ul>
<li>if the &#8216;g&#8217; flag is set, it can be called multiple times</li>
<li>if the &#8216;g&#8217; flag is not set, it will only return the first match</li>
</ul>
<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/RegExp.html#exec()" title="ActionScript Language Reference - RegExp.exec()">Click here</a> for the official documentation</p>
<hr/>
<h4>String.replace(pattern:RegExp, replacement:String):Boolean</h4>
<p>Replaces the pattern in the string with the replacement string.</p>
<ul>
<li>if &#8216;g&#8217; flag is set it replaces all matches in the string</li>
<li>if &#8216;g&#8217; is not set,only the first match is replaced</li>
<li>you can use group references like $1, $2, $`, $&#038;, $&#8217;</li>
</ul>
<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/String.html#replace()" title="ActionScript Language Reference - String.replace()">Click here</a> for the official documentation</p>
<hr/>
<h4>String.search(pattern:RegExp):int</h4>
<p>Returns the index of where the pattern is found in the string.</p>
<ul>
<li>returns -1 if there is no match</li>
<li>ignores the &#8216;g&#8217; flag and &#8216;.lastIndex&#8217; property</li>
</ul>
<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/String.html#search()" title="ActionScript Language Reference - String.search()">Click here</a> for the official documentation</p>
<hr/>
<h4>String.match(pattern:RegExp):Array</h4>
<p>Returns an Array populated with values relating to the pattern.</p>
<ul>
<li>if the &#8216;g&#8217; flag is not set, the array will be in the form of [fullpattern, group 1, group2]</li>
<li>if the &#8216;g&#8217; flag is set, the array will contain all the possible full pattern matches &#8211; [fullpattern1, fullpattern2]</li>
</ul>
<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/String.html#match()" title="ActionScript Language Reference - String.match()">Click here</a> for the official documentation</p>
<hr/>
<h2 id="syntax">Regular Expression Syntax</h2>
<p>Here is a quick run-through of the regular expression syntax as a bit of reference.</p>
<h3>Constructors</h3>
<p>There are two ways to set up a regular expression.</p>
<table class="reftable">
<tr>
<td><strong>/pattern/flags</strong></td>
<td><strong>Literal:</strong><br/>Just type the shorthand method, and bam, regular expression</td>
</tr>
<tr class="odd">
<td><strong>new RegExp(pattern:String, flags:String)</strong></td>
<td><strong>Constructor:</strong><br/>Construct it like any type of object, passing in a string of the pattern and the flags as parameters.<br/>Note: If using RegExp then you need to escape sequences &#8211; \\d instead of the normal \d</td>
</tr>
</table>
<h3>Flags</h3>
<p>Flags change the way the regular expression works. They also can effect the results of the regular expression methods in different ways.</p>
<table class="reftable">
<tr>
<td><strong>g</strong></td>
<td>Global</td>
</tr>
<tr class="odd">
<td><strong>i</strong></td>
<td>Case-insensitive</td>
</tr>
<tr>
<td><strong>m</strong></td>
<td>Multi-line</td>
</tr>
<tr class="odd">
<td><strong>s</strong></td>
<td>Dot all</td>
</tr>
<tr>
<td><strong>x</strong></td>
<td>Extended</td>
</tr>
</table>
<h3>Meta Characters</h3>
<p>Meta Characters are characters that have a special meaning when used inside a Regular Expression pattern.</p>
<table class="reftable">
<tr>
<td><strong>^</strong> (caret)</td>
<td>Matches the start of a string<br/>If using &#8216;multiline&#8217; (m) then it will match the start of a line.</td>
</tr>
<tr class="odd">
<td><strong>$</strong></td>
<td>Matches the end of a string<br/>If using multiline (m) then it will match the end of a line.</td>
</tr>
<tr>
<td><strong>\</strong></td>
<td>Escapes special characters. \d, \w, \\, etc </td>
</tr>
<tr class="odd">
<td><strong>.</strong> (period)</td>
<td>Matches any single character. <br/>If using the &#8216;dot all&#8217; (s) flag this will match new lines as well.</td>
</tr>
<tr>
<td><strong>*</strong></td>
<td>Matches the previous character 0 or more times.</td>
</tr>
<tr class="odd">
<td><strong>+</strong></td>
<td>Matches the previous character 1 or more times.</td>
</tr>
<tr>
<td><strong>?</strong></td>
<td>Matches previous character 0 or 1 time</td>
</tr>
<tr class="odd">
<td><strong>(  )</strong></td>
<td>Groups
<ul>
<li>define a scope of a quantifier (walla){1,2}</li>
<li>confine scope of the | alternator</li>
<li>used to define back references</li>
</ul>
</td>
</tr>
<tr>
<td><strong>[ ]</strong></td>
<td>Character Classes
<ul>
<li>Defines possible for matches for a single character</li>
<li>You can use hyphens to define a range &#8211; [A-Za-z0-9]</li>
<li>Backslash (\) escapes ] and -</li>
<li>^ in first position negates set</li>
<li>note &#8211; meta characters are treated as normal characters and need to be escaped to work &#8211; [\\d]</li>
</ul>
</td>
</tr>
<tr class="odd">
<td><strong>|</strong></td>
<td>Alternation / Logical Or &#8211; allows you to test between multiple patters<br/>(abc|xyz) matches abc or xyz<br/>/1|2|3|4|5/ equals [12345]</td>
</tr>
</table>
<h3>Meta Sequences</h3>
<p>Meta Sequences are special string that can be used to represent specific characters in a pattern.</p>
<table class="reftable">
<tr>
<td><strong>{n}<br/>{n,}<br/>{n,m}</strong></td>
<td>Numeric quantifier
<ul>
<li>A{27} = A 27 times</li>
<li>A{3,} = A 3 or more times</li>
<li>A{3,5} = A 3 to 5 times</li>
</ul>
</td>
</tr>
<tr class="odd">
<td><strong>\b</strong></td>
<td>Matches the position between a word character and a non-word character.  If first or last character in the string is a word character, also matches the start/end.</td>
</tr>
<tr>
<td><strong>\B</strong></td>
<td>Matches the position between 2 word characters.  Also matches the position between 2 non word characters.</td>
</tr>
<tr class="odd">
<td><strong>\d<br/>\D</strong></td>
<td>Decimals<br/>Non-decimals</td>
</tr>
<tr>
<td><strong>\f<br/>\n<br/>\r<br/>\v</strong></td>
<td>Form feed<br/>Newline<br/>Return<br/>Vertical feed</td>
</tr>
<tr class="odd">
<td><strong>\s<br/>\S</strong></td>
<td>Whitespace &#8211; space, tab, newline, return<br/>Non-whitespace</td>
</tr>
<tr>
<td><strong>\t</strong></td>
<td>Tab character</td>
</tr>
<tr class="odd">
<td><strong>\w<br/>\W</strong></td>
<td>Word character &#8211; A-Z, a-z, 0-9,_<br/>Non-word character</td>
</tr>
<tr>
<td><strong>\unnnn</strong></td>
<td>Matches unicode nnnn</td>
</tr>
<tr class="odd">
<td><strong>\xnn</strong></td>
<td>ascii character</td>
</tr>
</table>
<h3>Greedy Vs Non-Greedy</h3>
<p>Normally quantifiers like <strong>*</strong> and <strong>+</strong> are greedy, as in, they will try and match as much as they can.  They can be made lazy by adding a <strong>?</strong> afterward.</p>
<table class="reftable">
<tr>
<td>/&lt;p&gt;.*/&lt;/p&gt;/</td>
<td>greedy &#8211; the * will match as many characters as possible</td>
</tr>
<tr class="odd">
<td>/&lt;p&gt;.*?/&lt;/p&gt;/</td>
<td>lazy &#8211; the * will match the least amount of characters</td>
</tr>
</table>
<h3>Capturing sub-strings</h3>
<p>Sometimes when you are looking for a pattern in a string you need to work with a sub-string.  Maybe it is to replace it, or reference it is a new string.  Maybe you don&#8217;t know what exactly it is you have to match. That&#8217;s where this stuff comes in.</p>
<table class="reftable">
<tr>
<td><strong>\1, \2, etc</strong></td>
<td>Back reference<br/>Matches an earlier defined group in the pattern<br/>eg: /(\d+)-by-<strong>\1</strong>/ matches 48-by-48</td>
</tr>
<tr class="odd">
<td><strong>$1 &#8211; $nn</strong></td>
<td>Group references<br/>Can be used to reference groups in the String.replace() and RegExp.exec() methods<br />
<code class="as"><br />
	var str:String = "Hi, Sev";<br />
	str = str.replace(/Hi, (w+)/,"$1, hello");<br />
	trace(str);		// Sev, hello<br />
</code>
		</td>
</tr>
<tr>
<td><strong>$$</strong></td>
<td>Puts a $ in the replacement text (not really a sub-string reference, but sorta matches up with this stuff.)</td>
</tr>
<tr class="odd">
<td><strong>$&#038;</strong></td>
<td>References the fully matched string</td>
</tr>
<tr>
<td><strong>$`</strong></td>
<td>References the string preceding the matched pattern</td>
</tr>
<tr class="odd">
<td><strong>$&#8217;</strong></td>
<td>References the string following the matched pattern</td>
</tr>
<tr>
<td><strong>?:</strong></td>
<td>Non-capturing Group<br/>Sometimes you don&#8217;t want a group to be captured for back references, etc.  This is can be done by adding <strong>?:</strong> at the start of the group.<br/>eg: /(?:group)/</td>
</tr>
<tr class="odd">
<td><strong>(?P&lt;name&gt;.*):</strong></td>
<td>Named groups<br/>When used in RegExp.exec(), the group will be stored under a property with the &#8216;name&#8217;.<br/>Note: this is an AS3 only Regular Expression syntax.</td>
</tr>
</table>
<h2>Links</h2>
<p>Here are some links to some sites that help with regular expressions.</p>
<ul>
<li><a href="http://www.regular-expressions.info/" title="Regular Expressions Info">http://www.regular-expressions.info/</a></li>
<li><a href="http://regexlib.com/" title="Regular Expressions Library">http://regexlib.com/</a></li>
<li><a href="http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00000112.html" title="Flash LiveDocs Reference">Flash LiveDocs Reference on Regular Expression Syntax</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/actionscript/testing-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faking Depth of Field in Papervision 3D</title>
		<link>http://www.sevenson.com.au/actionscript/depth-of-field/</link>
		<comments>http://www.sevenson.com.au/actionscript/depth-of-field/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 12:56:51 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=350</guid>
		<description><![CDATA[A while back I was given my first flash project that required me to use Papervision 3D. If that wasn&#8217;t daunting enough, the design of the project required that there be a depth of field effect on the elements &#8211; something that papervision cannot do. (If i am wrong about that, please don&#8217;t tell me [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2009/08/icon.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/08/icon.jpg" alt="" title="Depth Of Field Icon" width="250" height="190" class="alignright size-full wp-image-545" /></a>A while back I was given my first flash project that required me to use <a href="http://www.papervision3d.org/">Papervision 3D</a>.    If that wasn&#8217;t daunting enough, the design of the project required that there be a depth of field effect on the elements &#8211; something that papervision cannot do.  (If i am wrong about that, please don&#8217;t tell me now&#8230;)</p>
<p>After learning the basics of papervision &#8211; which has plenty of tutorials on the interwebs &#8211; I started brainstorming an approach for faking depth of field.  Here is what I came up with.</p>
<p><span id="more-350"></span></p>
<p>Simplifying the concept, I basically just needed to &#8216;blur&#8217; the objects as they moved close to or far away from the camera.  I couldn&#8217;t blur the object itself, but I could change the textures on the fly, so that became the basis of my approach.</p>
<p>I couldn&#8217;t just blur the textures on the objects because the edges would not look right.  The blur needed to extend past the edge of the objects.  My solution for this was to set up extra 3d planes for each of the objects that needed blur.  As the objects moved, their distance from the camera was tested.  If they were outside the threshold area, the blurred plane object was substituted in, and the blurry textures were swapped around based on the particular distance.</p>
<p>It seemed to work pretty well.  Here is a slightly simplified version of the concept, using just the planes.  As you move the mouse around, you will see the planes appear to blur &#8211; this is the textures swapping</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_swfloader_1095218316"
			class="flashmovie"
			width="650"
			height="400">
	<param name="movie" value="http://www.sevenson.com.au/content/common/swfloader.swf" />
	<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/depthoffield/depthoffield.swf&amp;previewURL=http://www.sevenson.com.au/content/actionscript/depthoffield/preview.jpg&amp;clickToLoad=true" />
	<param name="quality" value="high" />
	<param name="scale" value="noscale" />
	<param name="wmode" value="window" />
	<param name="allowscriptaccess" value="always" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.sevenson.com.au/content/common/swfloader.swf"
			name="fm_swfloader_1095218316"
			width="650"
			height="400">
		<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/depthoffield/depthoffield.swf&amp;previewURL=http://www.sevenson.com.au/content/actionscript/depthoffield/preview.jpg&amp;clickToLoad=true" />
		<param name="quality" value="high" />
		<param name="scale" value="noscale" />
		<param name="wmode" value="window" />
		<param name="allowscriptaccess" value="always" />
	<!--<![endif]-->
		
<div class="missingFlash">There is supposed to be some flash stuff here</div>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Now for the funky bit.  Because there were a bunch of different textures I needed to work with, I didn&#8217;t want to have to created every level of blur for every image.  It would be burden on my time and increase download times.</p>
<p>What I ended up doing was created a method that took in one texture and generated all of the blurs for me.  Each of the different blurs was then stored in an array so that I could easily switch between them.</p>
<p>This is the code that I used, but looking at it now I could have done it a bit better dropping out the &#8216;draw()&#8217; method and applying the blur to the BitmapData directly.</p>
<p><code class="as"><br />
	/**<br />
	 * Generates an array of bitmap data objects ranging from no blur to the blur amount<br />
	 * @param	origBitmapData	- the original bitmap to blur<br />
	 * @param	blurAmount		- the maximum amount of blur to create<br />
	 * @param	steps			- the number of various blur amounts to generate<br />
	 * @return  An array of BitmapData objects<br />
	 */<br />
	public function generateBlurredBitmapArray(origBitmapData:BitmapData, blurAmount:Number = 40, steps:Number=8):Array {<br />
		// set up a return array to hold the data<br />
		var returnArray:Array = [];<br />
		// create the blur filter<br />
		var blur:BlurFilter = new BlurFilter(0,0,2);<br />
		// generate a sprite to apply the blur to<br />
		var s:Sprite = new Sprite();<br />
		// create a bitmap to hold the original bitmap data - add it to the sprite<br />
		var b:Bitmap = new Bitmap(origBitmapData, "auto", true);<br />
		s.addChild(b);<br />
		// position it in the centre<br />
		b.x = b.y = blurAmount;<br />
		// loop through and generate the required number of blurs<br />
		for (var i:uint = 0; i < steps; i++) {<br />
			// adjust the blur and apply it to the sprite<br />
			blur.blurX = blur.blurY = blurAmount * (i / (steps - 1))<br />
			s.filters = [blur];<br />
			// generate the new bitmap data<br />
			var newBmpData:BitmapData = new BitmapData(origBitmapData.width + (blurAmount * 2), origBitmapData.height + (blurAmount * 2), true, 0x00ffffff);<br />
			// draw the sprite to it<br />
			newBmpData.draw(s, null, null, null, null, true);<br />
			// add this to the return array<br />
			returnArray.push(newBmpData);<br />
		}<br />
		// return the array<br />
		return returnArray;<br />
	}<br />
</code></p>
<p>That's about it.  Hope that helps you out - let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/actionscript/depth-of-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Separating Axis Theorem (SAT) Explanation</title>
		<link>http://www.sevenson.com.au/actionscript/sat/</link>
		<comments>http://www.sevenson.com.au/actionscript/sat/#comments</comments>
		<pubDate>Sun, 24 May 2009 09:13:57 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://127.0.0.1/wordpress/?p=196</guid>
		<description><![CDATA[A quick and basic explanation of how SAT collision detection works, as well as some links and code you can download.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/icon4.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/icon4.jpg" alt="" title="SAT Icon" width="250" height="191" class="alignright size-full wp-image-561" /></a>Separating Axis Theorem (SAT) is a technique for calculating collisions between convex polygons.</p>
<p>I&#8217;m by no means an expert on it, but after the need arose for me to do some collision detection I did a pile of reading and finally got it working in ActionScript 3.</p>
<p>I thought I would share what I learned in the hope others wouldn&#8217;t suffer so much <img src='http://www.sevenson.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-196"></span></p>
<p>When I found myself in a need to calculate collisions between polygons in flash, I came across a method known as Separating Axis Theorem (SAT).  The only problem I had was that I really struggled to get a grasp on it.</p>
<p>After a lot of reading about collision detection, and looking at code samples, it all finally clicked.</p>
<p>To help out the other non-maths minded people I thought I would write this quick explanation to run through the basic principles of how it works. I&#8217;ve also included a demo using SAT collision detection, as well as some ActionScript 3 classes you can download and use.</p>
<p><strong>Note:</strong> SAT does require a bit of work with vector math, so it may be a good idea to brush up on your vectors before getting too far into SAT.</p>
<h3 id="demo">Interactive Demo:</h3>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_swfloader_2004425428"
			class="flashmovie"
			width="650"
			height="400">
	<param name="movie" value="http://www.sevenson.com.au/content/common/swfloader.swf" />
	<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/sat/sat.swf&amp;previewURL=http://www.sevenson.com.au/content/actionscript/sat/preview.jpg&amp;clickToLoad=true" />
	<param name="quality" value="high" />
	<param name="wmode" value="transparent" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.sevenson.com.au/content/common/swfloader.swf"
			name="fm_swfloader_2004425428"
			width="650"
			height="400">
		<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/sat/sat.swf&amp;previewURL=http://www.sevenson.com.au/content/actionscript/sat/preview.jpg&amp;clickToLoad=true" />
		<param name="quality" value="high" />
		<param name="wmode" value="transparent" />
	<!--<![endif]-->
		
<div class="missingFlash">Interactive Demo should be here</div>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Use your mouse to drag the shapes around. Whilst dragging, use the arrow keys to change the scale and rotation of the shapes.  When the two shapes collide they will change colour (red) and show a possible reaction (grey).</p>
<h3 id="rundown">The quick rundown</h3>
<p>Basically, the goal of SAT (and every other collision detection) is to test and see if is a gap between two shapes. The method that SAT uses is what makes it unique.</p>
<p>The best analogy I have heard for SAT technique is like this:</p>
<p>Imagine taking a torch and shining it on the two shapes you are testing from different angles. What sort of shadows would it cast on the wall behind it?</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/shadows.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/shadows.jpg" alt="" title="Illustration showing how a gap can be seen between 2 polygons" width="650" height="141" class="alignnone size-full wp-image-644" /></a></p>
<p>If you work your way around the shapes and never find a gap in the shadows then the objects must be touching. If you find a gap, then they are clearly not touching.</p>
<p>From a programming point of view it would be to intensive to check every possible angle. Luckily, due to the nature of the polygons, there is only a few key angles you need to check.</p>
<p>The angles you need to check are the same as the sides of the polygons. This means that the maximum number of angles to check is the sum of the number of sides the two shapes you are testing have. Eg. Two pentagons would require ten angles to be checked.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/angles.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/angles.jpg" alt="" title="This shows how the angles you need to test is related to the sides of the shapes you are testing" width="650" height="107" class="alignnone size-full wp-image-643" /></a></p>
<p><a name="codeprocess"></a></p>
<h3>So how do you make it work in code?</h3>
<p>It&#8217;s a simple but repetitive method, so here is a basic step by step:</p>
<p><strong>Step 1.</strong> Take one side from one of the polygons you are testing and find the normal (perpendicular) vector from it. This will be the &#8216;axis&#8217;.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/step1.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/step1.jpg" alt="" title="This shows the axis that you will need to project onto when testing this side." width="520" height="220" class="alignnone size-full wp-image-565" /></a></p>
<p><strong>Step 2.</strong> Loop through every point on the first polygon and project it onto the axis. (Keep track of the highest and lowest values found for this polygon)</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/step2.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/step2.jpg" alt="" title="Each point of the first shape is projected onto the axis we found in Step 1." width="520" height="220" class="alignnone size-full wp-image-566" /></a></p>
<p><strong>Step 3.</strong> Do the same for the second polygon.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/step3.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/step3.jpg" alt="" title="Each point from the second shape is also projected onto the axis." width="520" height="220" class="alignnone size-full wp-image-567" /></a></p>
<p><strong>Step 4.</strong> Check the values you found and see if they overlap.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/step4.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/step4.jpg" alt="" title="From this angle a gap can be seen in the &#039;shadows&#039; that the two shapes are projecting." width="520" height="220" class="alignnone size-full wp-image-568" /></a></p>
<p>If you find a gap between the two &#8216;shadows&#8217; you have projected onto the axis then the shapes must not intersect. However, if there is no gap, then they might be touching and you have to keep checking until you have gone through every side of both polygons.  If you get through them all without finding a gap then they collide.</p>
<p>That&#8217;s basically it.</p>
<p>As an added bonus, if you keep track of which axis has the smallest shadow overlap (and how much of an overlap that was) then you can apply that value to the shapes to separate them.</p>
<h4>What about circles?</h4>
<p>Testing a circle against a polygon in SAT is a little bit strange but it can be done.</p>
<p>The main thing to note is that a circle does not have any sides so there is no obvious axis that you can test against.  There is one &#8216;not so obvious&#8217; axis you do need to test however. This is the axis that runs from the centre of the circle to the closest vertex on the polygon.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/circle.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/circle.jpg" alt="" title="This is the axis you need to find when testing a circle for collision." width="321" height="220" class="alignnone size-full wp-image-563" /></a></p>
<p>After that it is just a matter of going through the usual routine of looping through every axis on the other polygon and checking for overlaps.</p>
<p>Oh, and in case you are wondering how to project a circle onto the axis, you simply project the centre point of the circle and then add and subtract the radius.</p>
<p><a name="procon"></a></p>
<h3>Pro&#8217;s and Con&#8217;s</h3>
<p>Like all collision detection techniques, SAT has it&#8217;s pro&#8217;s and cons.  Here is a quick rundown of some of them:</p>
<p>Pros</p>
<ul>
<li>It is fast &#8211; It uses pretty basic vector math and you can bail out of a test as soon as a gap is detected, eliminating unnecessary calculations.</li>
<li>It is accurate &#8211; at least as far as I can tell.</li>
</ul>
<p>Cons</p>
<ul>
<li>It only works with Convex polygons &#8211; complex shapes are out unless you build them out of smaller convex shapes, and then test each individual shape.</li>
<li>It doesn&#8217;t tell you which sides are touching &#8211; only how far they are overlapping and the shortest distance to separate them.</li>
</ul>
<p>There is probably a bunch more but these were the main ones I could think of.</p>
<p><a name="conclusion"></a></p>
<h3>Conclusion</h3>
<p>I hope that this has helped to shed some light on the separating axis theorem.  I&#8217;ve tried to keep it as simple as possible without shedding too much information.  (I&#8217;m by no means an expert in maths so I apologise if I left anything out)</p>
<p>Here are a few links to other pages that helped me understand SAT collision detection.</p>
<ul>
<li><a href="http://www.harveycartel.org/metanet/tutorials/tutorialA.html" target="_blank">harverycartel.org</a> &#8211; more detailed descriptions and some cool interactive examples. I learnt a lot from this page.</li>
<li><a href="http://gpwiki.org/index.php/VB:Tutorials:Building_A_Physics_Engine:Basic_Intersection_Detection" target="_blank">GPWiki.org</a>- good SAT explanation and sample code &#8211; I used this as a basis for creating my own code.</li>
<li><a href="http://www.tonypa.pri.ee/vectors/index.html" target="_blank">Tony Pa</a> &#8211; Vector tutorials &#8211; Good resource for learning about Vectors</li>
<li><a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=251638" target="_blank">GameDev.net forum</a> &#8211; a SAT collision system a member created &#8211; gave me some ideas on how to calculate reactions, etc.</li>
</ul>
<h3 id="download">Download:</h3>
<p>If you want to see my AS3 SAT classes you can download them here: <a href="http://www.sevenson.com.au/wp-content/plugins/download-monitor/download.php?id=3" title="Downloaded 416 times">SAT AS3 Classes</a> (They are a bit of a mess, but they work)</p>
<p>Basically, you create two shapes and then test them with the &#8216;Collision.test()&#8217; method.  If they touch then a &#8216;CollisionInfo&#8217; object will be returned. If they don&#8217;t touch then it will return &#8216;null&#8217;. The CollisionInfo object has a bunch of information about the collision that can be used to separate the two objects, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/actionscript/sat/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Reflection in ActionScript 3</title>
		<link>http://www.sevenson.com.au/actionscript/reflection/</link>
		<comments>http://www.sevenson.com.au/actionscript/reflection/#comments</comments>
		<pubDate>Sun, 24 May 2009 08:17:46 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://127.0.0.1/wordpress/?p=188</guid>
		<description><![CDATA[An ActionScript 3 class I wrote that dynamically generates reflections.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2009/05/icon5.jpg"><img src="http://www.sevenson.com.au/content/uploads/2009/05/icon5.jpg" alt="" title="Reflection Icon" width="250" height="190" class="alignright size-full wp-image-572" /></a>I was creating an online gallery for a project at work when came across the need for dynamically created reflections.  We had an existing class that we usually used for reflections, but it was a bad port from AS2 to AS3 and I was never happy with it. It tended to be hard to work with and pretty inefficient.</p>
<p>In an attempt to make things better, and make my life easier in the process, I sat down and created my own Reflection class.</p>
<p>Here is what I came up with.</p>
<p><span id="more-188"></span></p>
<p>Below is a sample of the result. The moving text shows how elements fade away from the reflection point.  Also, if you click and drag in the top half of the image you will see how the reflection can update dynamically.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_swfloader_1589533805"
			class="flashmovie"
			width="650"
			height="400">
	<param name="movie" value="http://www.sevenson.com.au/content/common/swfloader.swf" />
	<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/reflection/reflection.swf&amp;previewURL=http://www.sevenson.com.au/content/actionscript/reflection/preview.jpg&amp;clickToLoad=true" />
	<param name="quality" value="high" />
	<param name="wmode" value="transparent" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.sevenson.com.au/content/common/swfloader.swf"
			name="fm_swfloader_1589533805"
			width="650"
			height="400">
		<param name="flashvars" value="contentURL=http://www.sevenson.com.au/content/actionscript/reflection/reflection.swf&amp;previewURL=http://www.sevenson.com.au/content/actionscript/reflection/preview.jpg&amp;clickToLoad=true" />
		<param name="quality" value="high" />
		<param name="wmode" value="transparent" />
	<!--<![endif]-->
		
<div class="missingFlash">Reflection flash demo should be here</div>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>The idea behind the class is pretty simple. Basically, you create a new Reflection object and then pass it any display object that you want to reflect. Then, whenever you tell it to &#8216;refresh&#8217;, it will look at the target object, copy the bottom area, flip and fade it.</p>
<p>It uses the bounding rectangle of the target object to figure out what to reflect, but you can also override this by specifying a rectangle area to reflect.</p>
<p>You can also specify a number of different things, such as how tall you want the reflection be, how often it should refresh, and how transparent it should start and finish.</p>
<h3 id="download">Download:</h3>
<p>If you would like to check out the code for this reflection class you can do by downloading it here: <a href="http://www.sevenson.com.au/wp-content/plugins/download-monitor/download.php?id=4" title="Downloaded 209 times">Reflection Class AS3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/actionscript/reflection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
