<?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>zedia flash blog</title>
	<atom:link href="http://www.zedia.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Thu, 10 May 2012 20:00:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tricks when starting using the Starling framework</title>
		<link>http://www.zedia.net/2012/tricks-when-starting-using-the-starling-framework/</link>
		<comments>http://www.zedia.net/2012/tricks-when-starting-using-the-starling-framework/#comments</comments>
		<pubDate>Thu, 10 May 2012 20:00:11 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Starling]]></category>
		<category><![CDATA[Sparrow]]></category>
		<category><![CDATA[Stage3D]]></category>
		<category><![CDATA[Starling Framework]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=911</guid>
		<description><![CDATA[I am working on my next game, well trying to. I am a bit lazy but I am fighting that. Anyway I came to a point where performance was an issue in the prototype, so I decided it was time to jump into the Starling Framework. I have been wanting to try it for some [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on my next game, well trying to. I am a bit lazy but I am fighting that. Anyway I came to a point where performance was an issue in the prototype, so I decided it was time to jump into the <a title="Starling Framework" href="http://gamua.com/starling/" target="_blank">Starling Framework</a>.</p>
<p>I have been wanting to try it for some time and I must say it was quite easy to port my existing code to it since it uses the same API than the Flash display list. But there are a lot of little things that are different. I&#8217;m am going to list a few gotchas, but first I think every one new to Starling should read <a title="Thibault Imbert" href="http://www.bytearray.org" target="_blank">Thibault Imbert</a> <a title="Introducing Starling" href="http://shop.oreilly.com/product/0636920024217.do" target="_blank">book</a> (which is free) about it. It is only 122 pages long and it took me about 20 mins to go through it. Also the <a title="Starling Wiki" href="http://wiki.starling-framework.org/" target="_blank">wiki</a> on the starling framework website is quite useful.</p>
<h3>Starling; the walled garden</h3>
<p>Here is the code you need to start Startling:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">_starling = <span style="color: #000000; font-weight: bold;">new</span> Starling<span style="color: #66cc66;">&#40;</span>Game, <span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span>;
_starling.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Game being a class where you will control what will happen inside of Starling (also called the Root Class). Now you see my next game interface will use the normal Flash display list, but from it the user will be able to change stuff that happens on the graphics inside Starling. So I need a way to communicate with it, but there is no easy way to access the Game class&#8230; Here is the way I found:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">_starling.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ROOT_CREATED</span>, _onRootCreated<span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _onRootCreated<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	_starling.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ROOT_CREATED</span>, _onRootCreated<span style="color: #66cc66;">&#41;</span>;
	_game = Starling.<span style="color: #006600;">current</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">getChildAt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> as Game;
	_game.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span>_whateverData<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>If you ask me this is a bit hackish, mostly the stage.getChildAt(0) but it works. I think you should just be able to access it using Starling.rootClass but that is just me I guess. I read somewhere that you could listen to the Event.CONTEXT3D_CREATE but that didn&#8217;t work in the latest version.</p>
<h3>Little differences</h3>
<p>So they wanted Starling to be similar to the display list but some little differences remained. The first one I noticed was that the rotation property on a DisplayObject is in radians instead of degrees. A bit annoying but not really a huge thing. Starling comes with a utility function to convert angles that you can find here: starling.utils.deg2rad. They did this in order to be consistent with the Sparrow framework; not sure why Flash people should care but hey, what can you do&#8230;</p>
<p>Also if you are looking for filters on display objects, stop looking it&#8217;s not there.</p>
<p>Finally the is 2 great new properties on display object pivotX and pivotY which allow you to change the origin point which is really useful in rotations and scaling.</p>
<p>Well that is it for now, as I play more with it I should find more stuff and I will edit this post. Also, I will be working on a book soon, so I might not feel like writing on this blog too ( you know, like writing too much in one day).</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=911&amp;md5=774821a8b1355aca719fbf296f603463" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2012/tricks-when-starting-using-the-starling-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Doodle Complete on Kongregate</title>
		<link>http://www.zedia.net/2012/doodle-complete-on-kongregate/</link>
		<comments>http://www.zedia.net/2012/doodle-complete-on-kongregate/#comments</comments>
		<pubDate>Tue, 08 May 2012 19:59:53 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Admob]]></category>
		<category><![CDATA[BlackBerry PlayBook]]></category>
		<category><![CDATA[Doodle Complete]]></category>
		<category><![CDATA[Flash Game License]]></category>
		<category><![CDATA[iAds]]></category>
		<category><![CDATA[Kongregate]]></category>
		<category><![CDATA[Milkman games]]></category>
		<category><![CDATA[MochiAds]]></category>
		<category><![CDATA[newgrounds]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=905</guid>
		<description><![CDATA[After a six weeks waiting for sponsors on Flash Game License and a ridiculous bid of 75$, I decided to finally release my game Doodle Complete on the web. The 75$ bid was even more ridiculous than that, the bidder also wanted to collect the money from advertisement and release the game under their name on [...]]]></description>
			<content:encoded><![CDATA[<p>After a six weeks waiting for sponsors on <a title="Flash Game License" href="http://www.flashgamelicense.com" target="_blank">Flash Game License</a> and a ridiculous bid of 75$, I decided to finally release my game <a title="Doodle Complete" href="http://www.kongregate.com/games/Albataur/doodle-complete" target="_blank">Doodle Complete</a> on the web. The 75$ bid was even more ridiculous than that, the bidder also wanted to collect the money from advertisement and release the game under their name on <a title="Doodle Complete on Kongregate" href="http://www.kongregate.com/games/Albataur/doodle-complete" target="_blank">Kongregate</a> and Newgrounds (well new grounds require the game to be only 700px height so my game won&#8217;t fit there&#8230;). So I decided to release it without sponsors and to at least get some information about advertisements revenues. I spent all day yesterday trying to get Admob working for the <a title="Doodle Complete on BlackBerry PlayBook" href="http://appworld.blackberry.com/webstore/content/86854/?lang=en" target="_blank">Blackberry Playbook</a> (yes you can get it on your PlayBook now!), but I couldn&#8217;t really do it. I also made it available with <a title="Doodle Complete on Mochi Games" href="http://www.mochimedia.com/games/play/doodle-complete" target="_blank">MochiAds</a> and to their distribution network which already gave me 2000 views, so that is good.</p>
<p>Now, it seems like people on <a title="Doodle Complete on Kongregate" href="http://www.kongregate.com/games/Albataur/doodle-complete" target="_blank">Kongregate</a> don&#8217;t really like the game because the controls are hard&#8230; Well I could do something there, but I don&#8217;t think it would make people go crazy about the game anyway. So I kinda decided to let it go. I&#8217;m going to fix the minor bugs, but I won&#8217;t put anymore time on this game and start working on the next one which will be more classical, little risks that people will complain about the controls.</p>
<p>Last thing I will do is try the <a title="iAd extension for iOs" href="http://www.milkmangames.com/blog/tools/" target="_blank">iAd extension for iOs from Milkman games</a> to see if those revenues are worth the trouble. I will have to pay 20$, but I guess I will have it for other games too.</p>
<p>Anyway go play the game on <a title="Doodle Complete on Kongregate" href="http://www.kongregate.com/games/Albataur/doodle-complete" target="_blank">Kongregate</a> and if you can give it 5 stars <img src='http://www.zedia.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.kongregate.com/games/Albataur/doodle-complete"><img class="aligncenter size-full wp-image-906" title="DoodleCompleteScreen1" src="http://www.zedia.net/wp-content/uploads/2012/05/DoodleCompleteScreen1.png" alt="" width="480" height="640" /></a></p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=905&amp;md5=ccb8abd8211d7904708cd36f314d0889" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2012/doodle-complete-on-kongregate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Little games for Lassonde based on Madagascar 3</title>
		<link>http://www.zedia.net/2012/little-games-for-lassonde-based-on-madagascar-3/</link>
		<comments>http://www.zedia.net/2012/little-games-for-lassonde-based-on-madagascar-3/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 20:01:00 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Fruite]]></category>
		<category><![CDATA[Lassonde]]></category>
		<category><![CDATA[Madagascar 3]]></category>
		<category><![CDATA[Robotlegs]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=901</guid>
		<description><![CDATA[Didn&#8217;t have much to show since I came back from the States, but here is a little project that was pretty fun to do. Fruite Madagascar 3. My part in it was to do the games: Burst-A-Balloon, Pin the zebra and Memory game. Felt really good to have a project that didn&#8217;t become extremely complicated [...]]]></description>
			<content:encoded><![CDATA[<p>Didn&#8217;t have much to show since I came back from the States, but here is a little project that was pretty fun to do. <a title="Fruite Madagascar 3" href="http://www.fruitemad3.com/" target="_blank">Fruite Madagascar 3</a>. My part in it was to do the games: <a title="Burst a balloon" href="http://www.fruitemad3.com/Burst_a_balloon_game-en-8.php?game=penguin" target="_blank">Burst-A-Balloon</a>, <a title="Pin the zebra" href="http://www.fruitemad3.com/Pin_the_Zebra_game-en-7.php?game=zebra" target="_blank">Pin the zebra</a> and <a title="Memory game" href="http://www.fruitemad3.com/Memory_Gane-en-6.php?game=memory" target="_blank">Memory game</a>.</p>
<p><a href="http://www.zedia.net/wp-content/uploads/2012/04/Penguins.jpg"><img class="aligncenter size-full wp-image-902" title="Penguins!!!!" src="http://www.zedia.net/wp-content/uploads/2012/04/Penguins.jpg" alt="" width="600" height="294" /></a></p>
<p>Felt really good to have a project that didn&#8217;t become extremely complicated after a while <img src='http://www.zedia.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I used Robotlegs for all of them, and I reused a lot of code in each game. Seems like Robotlegs ain&#8217;t the preferred framework when building games, but in this case performance wasn&#8217;t really an issue so I liked it a lot.</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=901&amp;md5=ea1c50e0b44daa9b05d9bf31eb46ccb1" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2012/little-games-for-lassonde-based-on-madagascar-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My views on Adobe licensing the use of Stage3D in conjunction to the memory opcodes</title>
		<link>http://www.zedia.net/2012/my-views-on-adobe-licensing-the-use-of-stage3d-in-conjunction-to-the-memory-opcodes/</link>
		<comments>http://www.zedia.net/2012/my-views-on-adobe-licensing-the-use-of-stage3d-in-conjunction-to-the-memory-opcodes/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 19:44:09 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[opcodes]]></category>
		<category><![CDATA[Stage3D]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=898</guid>
		<description><![CDATA[I have been reading about this an nothing I found was really expressing what I fell about it. The thing is I never really had a project that could benefit from using the opcodes. I mean I have built rich experiences for the past 5 years and some of my projects were pretty complex. Stage3D [...]]]></description>
			<content:encoded><![CDATA[<p>I have been reading about this an nothing I found was really expressing what I fell about it. The thing is I never really had a project that could benefit from using the opcodes. I mean I have built rich experiences for the past 5 years and some of my projects were pretty complex. Stage3D I would use, big time, but not to build some crazy 3D world, I don&#8217;t have the 3D skills for that. My point being, in the state that it is in I don&#8217;t think I would ever use the memory opcodes and I believe it is so for 90% of the developers out there. Now I know that on the Flash roadmap from Adobe they are planning to give easier access to the memory opcodes, maybe that will change my views on this, but it hasn&#8217;t been done yet.</p>
<p>Lastly, on the 9% thing, this is the amount of money you must give Adobe once you have made more than 50k revenues using Stage3D and the opcodes, I think it&#8217;s fair. I think the Unreal engine has a similar licensing model, where you don&#8217;t pay anything unless you have made 100k. If I ever come to have to pay the fees, it will be a problem that I will be happy to deal with as I will have some kind of success anyway. What do you guys think? Am I a senseless individualist bastard or do you agree that it is mostly the elite crying out?</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=898&amp;md5=937645b74d0a0c4295b92ca783ad7957" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2012/my-views-on-adobe-licensing-the-use-of-stage3d-in-conjunction-to-the-memory-opcodes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cinemagram, a must have app</title>
		<link>http://www.zedia.net/2012/cinemagram-a-must-have-app/</link>
		<comments>http://www.zedia.net/2012/cinemagram-a-must-have-app/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 16:59:40 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Cinemagram]]></category>
		<category><![CDATA[Cinemagraph]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=892</guid>
		<description><![CDATA[Well this is not a shameless plug because it is not for me, but actually for a friend of mine. For the past month he has been working very hard on his iPhone application and for having seen the progress along the way, I can say that it is awesome work. The application is called [...]]]></description>
			<content:encoded><![CDATA[<p>Well this is not a shameless plug because it is not for me, but actually for a friend of mine. For the past month he has been working very hard on his <a title="Cinemagram" href="http://itunes.apple.com/app/cinemagram/id487225881" target="_blank">iPhone application</a> and for having seen the progress along the way, I can say that it is awesome work. The application is called <a title="Cinemagram" href="http://itunes.apple.com/app/cinemagram/id487225881" target="_blank">Cinemagram</a> and it is made to easily build <a title="Cinemagraph" href="http://en.wikipedia.org/wiki/Cinemagraph" target="_blank">cinemagraph</a> with your mobile phone. Cinemagraph are still pictures where only a small part of it is moving.  To do them it would usually require an image editing software and a lot of manipulations, but the app makes it really easy to do right with your phone. Anyway, I think that for 2$ you can have a lot of fun building cinemagraphs, so <a title="Cinemagram" href="http://itunes.apple.com/app/cinemagram/id487225881" target="_blank">go buy the app</a> and help some indie devs!</p>
<p>Here are some example of cinemagraphs done with the app:</p>
<p style="text-align: center;"><img class="aligncenter" title="Blow ball cinemagraph" src="http://cinemagr.am/uploads/57221.gif" alt="Blow ball cinemagraph" width="360" height="480" /></p>
<p>&nbsp;</p>
<p style="text-align: center;"><img class="aligncenter" title="(p)harmacy cinamegraph" src="http://cinemagr.am/uploads/57749.gif" alt="" width="480" height="360" /></p>
<p>&nbsp;</p>
<p style="text-align: center;"><img class="aligncenter" title="Bowl cinemagraph" src="http://cinemagr.am/uploads/52421.gif" alt="" width="360" height="480" /></p>
<p style="text-align: center;">
<p style="text-align: left;">If you want to see more you can go to the <a title="Cinemagr.am" href="http://cinemagram.tumblr.com/" target="_blank">Cinemagr.am website</a>.</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=892&amp;md5=803aec2a3c7ec86084f67804d2062218" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2012/cinemagram-a-must-have-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>haXe, NME, RobotHaxe, Git, GitHub, brains exploded</title>
		<link>http://www.zedia.net/2012/haxe-nme-robothaxe-git-github-brains-exploded/</link>
		<comments>http://www.zedia.net/2012/haxe-nme-robothaxe-git-github-brains-exploded/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 17:58:56 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[NME]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[FlashDevelop]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[HaXe]]></category>
		<category><![CDATA[iOs]]></category>
		<category><![CDATA[RobotHaxe]]></category>
		<category><![CDATA[Robotlegs]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=885</guid>
		<description><![CDATA[Hell yeah! Crazy day. Spent all day figuring stuff out, now I&#8217;m pretty tired but I have to share my findings. NME, a cross-platform solution So, I am looking for a true cross platform development solution that will give me output for iOs, Android and Web (Flash). Using Flash and Air is too slow for me, but [...]]]></description>
			<content:encoded><![CDATA[<p>Hell yeah! Crazy day. Spent all day figuring stuff out, now I&#8217;m pretty tired but I have to share my findings.</p>
<h3>NME, a cross-platform solution</h3>
<p>So, I am looking for a true cross platform development solution that will give me output for iOs, Android and Web (Flash). <a title="Optimizing Flash for the iPad" href="http://www.zedia.net/2012/optimizing-flash-for-the-ipad/">Using Flash and Air is too slow for me</a>, but I do like ActionScript 3 a lot so <a title="NME" href="http://www.haxenme.org">NME</a> seems like the logical solution. What is exactly NME? You know what? I don&#8217;t really know. It uses <a title="haXe" href="http://www.haxe.org/" target="_blank">haXe</a> and I think haXe is a programming language based on ActionScript. NME can compile both to Flash and C++ (and many more). That is as much as I could figure out, but I&#8217;ll keep digging.</p>
<p>Installing haXe and NME seemed pretty straight forward and it seemed to have worked, the only trouble I had was with <a title="Troubles when trying to develop for NME" href="http://www.flashdevelop.org/community/viewtopic.php?f=13&amp;t=9370" target="_blank">FlashDevelop</a>. Syntax high lighting is all off and it doesn&#8217;t seem to find where the classes are. But it compiles so I could at least get some stuff done.</p>
<h3>From ActionScript to haXe</h3>
<p>Actually that part isn&#8217;t that bad, there are little differences which you can find on this <a title="ActionScript to NME cheat sheet" href="http://www.haxenme.org/developers/documentation/actionscript-developers/" target="_blank">cheat sheet</a>, but there are also concepts that are totally oblivious to me like the Dynamic type. But I just rolled with it and everything kept working, so this is something I&#8217;ll figure out later too. Little annoying thing every class needs a constructor (but at least the function name is only &#8220;new&#8221;) and if you extends something, you have to call super. Also, I noticed that on the NME Sprite (<a title="NME Sprite" href="http://www.haxenme.org/api/types/nme/display/Sprite.html" target="_blank">nme.display.Sprite</a>), there is no rotationY property (well this is particular to NME, and I have never used rotationY before until 2 days ago, so I find this very funny).</p>
<h3>On to RobotHaxe</h3>
<p>Well I can&#8217;t really do anything without <a title="Robotlegs" href="http://www.robotlegs.org" target="_blank">Robotlegs</a>. I like how simple things are with it and well organized, so if I was going to move to another language, it needed to have Robotlegs. Period. Well I also need to be able to embed Fonts, have a Tweening engine and something to replace timeline animations, Robotlegs is the most important. Turns out there is a port to haXe called <a title="RobotHaxe by David Peek" href="https://github.com/DavidPeek/robothaxe" target="_blank">RobotHaxe made by David Peek</a>. The only problem, there is no documentation, no examples, no tutorials&#8230; I decided to give it a shot anyway, how hard could it be? Kinda hard&#8230; haha. Anyway I got it to work, not sure it is the best way to do it, but it works (for what I have tested). I made this test <a title="RobotHaxe Example" href="https://github.com/zedia/RobotHaxe-example" target="_blank">RobotHaxe project using FlashDevelop and NME</a>, not sure what it implies but I think it can be useful to people so I am giving it to you.</p>
<h3>Git and GitHub</h3>
<p>I never used Git before, always used SVN so that was new territory also. I also used to make a zip file and give my sources like that, but I figure GitHub is a better solution since you can browse before downloading. Anyway I put my test project on it. So go check it out here : <a title="RobotHaxe Example Help" href="https://github.com/zedia/RobotHaxe-example" target="_blank">Example RobotHaxe Project for NME</a> and give me feedback or tell me how I could do it better, because I really don&#8217;t think it is perfect. But it is better than any other example out there. ( I know there is a bunch of guys using RobotHaxe for JavaScript, but the code I have seen from them wouldn&#8217;t work in Flash so it wasn&#8217;t really helpful)</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=885&amp;md5=a9a275c7ef195e551b1111f25d69dfdf" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2012/haxe-nme-robothaxe-git-github-brains-exploded/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Optimizing Flash for the iPad</title>
		<link>http://www.zedia.net/2012/optimizing-flash-for-the-ipad/</link>
		<comments>http://www.zedia.net/2012/optimizing-flash-for-the-ipad/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 21:01:48 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blitting]]></category>
		<category><![CDATA[Corona]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iOs]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[object pooling]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[Stage3D]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=881</guid>
		<description><![CDATA[You might know that I am making a game for the iPad and it&#8217;s nearly done. The thing is, I also want to publish it on the web, you know, make money from sponsorship too. Actually, I think it might be the only way I make money with the game as the iPad app market [...]]]></description>
			<content:encoded><![CDATA[<p>You might know that I am making a game for the iPad and it&#8217;s nearly done. The thing is, I also want to publish it on the web, you know, make money from sponsorship too. Actually, I think it might be the only way I make money with the game as the iPad app market seems really hard. Plus it will also cost me money to publish in the Apple app store (developer account), so I think I might be loosing money going that way. Anyway, I was testing my game for the web first and everything was working fine. I tested on the iPad after and that is when things started to get hairy.</p>
<p>Yeah, an iPad (iPad 2) is not a full fledged computer (funny to say this considering my first computer was a 486), so it is not as fast. Well I have seen some pretty crazy shit on the iPad, like the Dead Space game so I guess it can be pretty strong. This only means that the Flash player isn&#8217;t that great on it, probably because it doesn&#8217;t use the GPU. So as I was testing my game on the iPad, it started out working really great, but as the game went on, more and more objects got drawn onto the screen and that is when the performance started to go down. So I set out to optimize my code.</p>
<h3>Object pooling</h3>
<p>Object creation in Flash is an operation that is costly and since I hadn&#8217;t optimized anything yet, I was recreating every object on the screen every frame. There is a possibility of having 240 objects on the screen at the same time, so that&#8217;s a lot of object creating every frame. To minimize this, you can do object pooling, which is having a pool of already created objects and change their properties instead of creating new ones. I did just that and it went really fast to implement. The thing is, when I tested it on the iPad, it made no difference at all.</p>
<h3>Blitting</h3>
<p>Another thing that is heavy on the CPU in Flash is updating graphics, so I tried to optimize that part. Blitting is a technique by which you compress all your visual into only one Bitmap that you draw on the screen. So instead of having multiple display objects being redrawn (in my case 240), you only have one. <a title="Blitting As3" href="http://www.8bitrocket.com/2008/07/02/tutorial-as3-the-basics-of-tile-sheet-animation-or-blitting/">Read more about blitting here</a>. Blitting doesn&#8217;t fit well with every project (like those relying on vector graphics) , but mine was based on Bitmaps and didn&#8217;t have a lot of rotations (it did, but only 90 degrees one) so I could easily do it. I was pretty sure that this would help a lot, but it actually did nothing noticeable. I was a bit baffled here, maybe my redrawn zone is too big&#8230; It is a game for iPad so I have a full resolution of 1024 x 768, maybe that is too heavy for the Flash Player.</p>
<h3>Code Optimization</h3>
<p>So if it wasn&#8217;t the creation of objects or the graphics, than maybe it was the code. I had used Arrays everywhere cause it is just simpler to use than Vectors, so I changed them all. I also did some loop optimization and replaced some divisions by multiplications ( like /2 to *0.5). Also didn&#8217;t change anything&#8230;</p>
<h3>Last Resort</h3>
<p>My last resort was to change the game dynamics so that the game is less intensive on the CPU and that is the only thing that made any impact on performance. My game is a puzzle, so I removed 3 rows and 1 column from it thus reducing the possible maximum number of object on the screen (and also the redrawn region size, and probably also the number of computations) by 20%.</p>
<h3>Conclusions</h3>
<p>I&#8217;m pretty sad at this point, changing the game dynamics to optimize is not a really good decision, it&#8217;s kinda like saying let&#8217;s make the game less fun to make it run faster. What I liked about Flash is that I could compile for the web, iOs and Android with limited changes (in this case all I changed was different layouts based on size (height and width) of the game). Turns out it is not fast enough on iOs (iPad). Maybe when they put Stage3D on iOs that will do it, but till than there is no true cross development platform. I meant to look into <a title="Corona" href="http://www.anscamobile.com/corona/">Corona</a>, but it does only mobile. And I really don&#8217;t want to fall into the HTML5 mess. I would really like to hear about a dev story about HTML5 and a game built for web and mobile and most importantly how much time it took to do.</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=881&amp;md5=f81b7448eacfd1773d85107efd4cb44d" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2012/optimizing-flash-for-the-ipad/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Happy 2012!</title>
		<link>http://www.zedia.net/2012/happy-2012/</link>
		<comments>http://www.zedia.net/2012/happy-2012/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 21:21:01 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[HaXe]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=877</guid>
		<description><![CDATA[4 years I have been writing on this blog. I am kinda proud, but I do have to ramp up the pace.  It&#8217;s been 4 months since I left B-Reel and let&#8217;s say that I have been semi-productive. I have not been doing nothing but I have not worked 7 hours everyday, not even 5 [...]]]></description>
			<content:encoded><![CDATA[<p>4 years I have been writing on this blog. I am kinda proud, but I do have to ramp up the pace.  It&#8217;s been 4 months since I left B-Reel and let&#8217;s say that I have been semi-productive. I have not been doing nothing but I have not worked 7 hours everyday, not even 5 like I wanted. Kinda hard to wake up early when you are your own boss. Also, I only wrote 4 posts in 4 months so the traffic to the site diminished a bit but nothing too serious.</p>
<p>So here we go for 2012, I am about to finish a personal game and a contracted game, so that is good. I have another game that is about 45% completed, so I will be working on that next. My goal is to complete 3 personal games this year, not including the one that is almost finished. Don&#8217;t know if I&#8217;ll be able to make it, but it sure would be good. I would also like to post 2 times a month, to be realistic, more would be better but I am not sure I will have the material to write as much. I will probably also try to look into HaXe, I am very curious about this tech, what it can do and how to use it so we will see.</p>
<p>So happy 2012 for everyone!</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=877&amp;md5=46b6594ed289ccd734cfbb10100389d7" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2012/happy-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My game on a iPad, my pilgrimage</title>
		<link>http://www.zedia.net/2011/my-game-on-a-ipad-my-pilgrimage/</link>
		<comments>http://www.zedia.net/2011/my-game-on-a-ipad-my-pilgrimage/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 16:58:23 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Game]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[certificates]]></category>
		<category><![CDATA[FlashDevelop]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[iOs]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[Keychain]]></category>
		<category><![CDATA[OpenSSL]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=872</guid>
		<description><![CDATA[YEAHH! Pretty nice is the feeling you get when you see your game for the first time on the medium it is supposed to be. Yesterday I dwelled in the mysteriously complicated world of signing applications for the Apple App Store. 6 hours it took me to finally get my game on my tablet ( [...]]]></description>
			<content:encoded><![CDATA[<p>YEAHH! Pretty nice is the feeling you get when you see your game for the first time on the medium it is supposed to be. Yesterday I dwelled in the mysteriously complicated world of signing applications for the Apple App Store. 6 hours it took me to finally get my game on my tablet ( by the way I didn&#8217;t buy the iPad, I won it <img src='http://www.zedia.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). I would say that 2/3 of that I was stuck in Apple developer center where you have to do numerous steps and get many files in order to sign your app / game. The last third came from converting one certificate to something Flash can use to compile a .ipa file.</p>
<p>For that step you can either do it on OSX or on Windows differently and since I have both installed on my machine, I thought I would do it the easy way ( what I thought would be) on OSX, but for some reasons Keychain access didn&#8217;t seem to export me the right things. So I had to do everything using OpenSSL on Windows, which after a little tweak, worked like a charm. Follow these instructions from Adobe to do so: <a title="Generate certificate signing request" href="http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-8000.html" target="_blank">generate signing request</a>, <a title="Convert certificate to .p12" href="http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-7fff.html" target="_blank">convert certificate to .p12</a>.</p>
<p>So with that done, I was set to compile my Flash game into an iOs app. This proved also more complicated than what I thought. My game was built using FlashDevelop, but I have Flash CS5.5 so I thought it was just a matter of setting my main class as the document class of a new fla. Turns out the Flash compiler is different from the Flex compiler and it started throwing me a lot of weird errors. I have to admit my project is a bit weird too (I lost one fla, so I had to decompile one file but I couldn&#8217;t get the font out of it, so I have 2 swc that have symbols in common), but it should have worked. Anyway, you don&#8217;t need Flash to compile to iOs. I downloaded the new Flex SDK and the latest AIR SDK (4.6 and 3.1) and used those <a title="FlashDevelop templates for iOs" href="http://www.emibap.com/2011/10/air-3-mobile-flashdevelop-templates-for-ios-and-android-publishing/" target="_blank">templates for FlashDevelop</a> and it worked mighty fine. Funny thing, my game was already compiled using the Flex 4.5.1 SDK; not AIR  (I am not using anything special) and not the latest SDK, but I didn&#8217;t have to recompile it, I just packaged it and it worked fine. I wonder if I use the AIR compiler instead if it would run faster???</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=872&amp;md5=c624a7d8828510933838c28a49148490" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2011/my-game-on-a-ipad-my-pilgrimage/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adobe stops Flash mobile dev (or how I finally found something to write about)</title>
		<link>http://www.zedia.net/2011/adobe-stops-flash-mobile-dev-or-how-i-finally-found-something-to-write-about/</link>
		<comments>http://www.zedia.net/2011/adobe-stops-flash-mobile-dev-or-how-i-finally-found-something-to-write-about/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 21:24:40 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=867</guid>
		<description><![CDATA[Haha, yeah, haven&#8217;t wrote much lately, not that I don&#8217;t want to, I just don&#8217;t have anything to write about, but now Adobe did give me something. So, they will stop working on the mobile version of the Flash player. A lot of people talked to me about it this morning, with big grins in [...]]]></description>
			<content:encoded><![CDATA[<p>Haha, yeah, haven&#8217;t wrote much lately, not that I don&#8217;t want to, I just don&#8217;t have anything to write about, but now Adobe did give me something. So, they will stop working on the mobile version of the Flash player. A lot of people talked to me about it this morning, with big grins in their faces, like saying: &#8220;See, see, it&#8217;s dead already&#8221;. Damn people are clueless sometimes, haha. I don&#8217;t think it&#8217;s that big of a deal right now, right now I mean, but I think it could mean way more in the future.</p>
<p>Ya, right now, on a phone, with its screen size, it is not the best way to consume Flash rich experiences like <a title="Aldo shoes for life" href="http://www.aldoshoesforalifetime.com/">Aldo Shoes for Life</a>. The screen is too small, you don&#8217;t get as much as what you get on the desktop. But the same goes for HTML rich experiences; would you interact with <a title="The Wilderness Downtown" href="http://www.thewildernessdowntown.com/">the Wilderness Downtown</a> on a mobile phone? I don&#8217;t think so. Where I think it is more problematic, is on tablets, where the screen has more real estate. Most rich experiences would work pretty well on that. The problem is that the only tablet worth the name is the iPad (well that will change in time) so no one could see rich flash experiences on them and realize that it is working quite well.</p>
<p>So short term, no biggie, doesn&#8217;t really change much, nobody was doing Flash sites for mobile anyway. Long term, it&#8217;s hard to say. Phones are gonna get bigger screens that I am sure off, be it foldable screens or some other innovation, screens will get bigger. Also, there will be more tablets out there and their uses will be more defined. For that alone, it would be nice to have Flash on mobile. Then, there is the new mobile application paradigm, where instead of building web experiences and apps, you build native apps. I don&#8217;t know if this is a trend that will last forever. I mean the desktop is slowly moving toward web and cloud, shouldn&#8217;t mobile do the same too? So I think it might be a mistake to stop mobile development.</p>
<p>But I also understand a bit, I mean Adobe was already developing 3 Flash players : PC, MAC, Linux. Now with mobile, it would have to develop one for every mobile operating. So here it is, my views on the topic, one more in the sea of web.</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=867&amp;md5=833c74ce3d1db782f6532fcda1d7eec1" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2011/adobe-stops-flash-mobile-dev-or-how-i-finally-found-something-to-write-about/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

