<?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>simonrichardson.info</title> <atom:link href="http://www.simonrichardson.info/feed/" rel="self" type="application/rss+xml" /><link>http://www.simonrichardson.info</link> <description>ActionScript &#38; Android</description> <lastBuildDate>Mon, 05 Dec 2011 09:54:05 +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>Closing down</title><link>http://www.simonrichardson.info/2011/12/05/closing-down/</link> <comments>http://www.simonrichardson.info/2011/12/05/closing-down/#comments</comments> <pubDate>Mon, 05 Dec 2011 09:52:11 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[Uncategorized]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=214</guid> <description><![CDATA[I&#8217;ve tried the last couple of years to keep a blog up to date, but I&#8217;ve just not got enough time at the moment. I could make a snide remark that I&#8217;m going the way of the Flash runtime, but that would be harsh! Also if you actually want to keep up with my stuff [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve tried the last couple of years to keep a blog up to date, but I&#8217;ve just not got enough time at the moment. I could make a snide remark that I&#8217;m going the way of the Flash runtime, but that would be harsh! Also if you actually want to keep up with my stuff it is better to use <a
href="https://github.com/stickupkid" title="github">github</a> or <a
href="http://www.last.fm/user/cereals" title="last.fm">last.fm</a> or follow me on <a
href="http://twitter.com/#!/stickupkid" title="twitter">twitter</a>.</p><p>This will be around until the hosting runs out, which is about 5 days or so.</p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/12/05/closing-down/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Missed opportunity</title><link>http://www.simonrichardson.info/2011/08/05/missed-opportunity/</link> <comments>http://www.simonrichardson.info/2011/08/05/missed-opportunity/#comments</comments> <pubDate>Fri, 05 Aug 2011 10:42:45 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[ActionScript]]></category> <category><![CDATA[ActionScript3]]></category> <category><![CDATA[Compiler]]></category> <category><![CDATA[performance]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=201</guid> <description><![CDATA[Again I&#8217;m talking about Adobe and another missed opportunity in regards to the AVM/ActionScript3 stack. The following is a criticism of the company and not thinking about the broader horizons, not really anticipating what developers want. It&#8217;s only now that I believe they&#8217;re beginning to understanding this, but I think it&#8217;s a little too late, [...]]]></description> <content:encoded><![CDATA[<p>Again I&#8217;m talking about Adobe and another missed opportunity in regards to the AVM/ActionScript3 stack. The following is a criticism of the company and not thinking about the broader horizons, not really anticipating what developers want. It&#8217;s only now that I believe they&#8217;re beginning to understanding this, but I think it&#8217;s a little too late, the ship has sailed! Developers are what push the technology, look at all the 3D engines created 3-4 years back with massive push of client projects and money for developers. It&#8217;s only now that real 3D was implemented!</p><p>Look how Javascript/CSS3 has moved to the forefront, developers are implementing what flash could do a few years back, but are improving it with semantics and readability. Taking on some of the frailties of Flash (screen readability, fallbacks and other browser implementation issues), don&#8217;t get me wrong, it&#8217;s still not perfect, but it&#8217;s better than some of Flash&#8217;s attempts.</p><p>I know that there is only a limited amount of resources to implement some of the things developers want, but it seems that they&#8217;re not thinking about the broader picture. The company has spent quite a long time implementing the iOS packaging tool for Flash for example. It&#8217;s a great little tool, but probably underused considering it&#8217;s possible potential. Why do I talk about this, well it turns out that the way the packaging tool works is that it provides away to compile your ActionScript3 code via the <a
href="http://llvm.org/">LLVM</a> into AVM code. It now turns from a JIT compiled language to AOT compiled language with some issues currently that you can&#8217;t have multiple swfs with code in them. This missed opportunity here is that LLVM can have many backend outputs, Adobe only implemented/used one backend and that&#8217;s targeting ARM (for iOS). It would be that much of a stretch of imagination to implement a different backend, C/C++/Java (the list continues). So instead of seeing ActionScript as a dead end language with no possible road a head long term (unlike <a
href="http://haxe.org">haXe</a>) there could have been a possibility where your ActionScript code could run natively on any platform with the speed of C/C++ (hand written code would obviously be much faster that this version, but it would be faster than running on the AVM!).</p><p>Imagine the possibilities, super fast code with the ease of developing with ActionScript&#8230; shame it&#8217;s never going to happen!</p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/08/05/missed-opportunity/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Eleven. Exactly. One louder.</title><link>http://www.simonrichardson.info/2011/07/14/eleven-exactly-one-louder/</link> <comments>http://www.simonrichardson.info/2011/07/14/eleven-exactly-one-louder/#comments</comments> <pubDate>Thu, 14 Jul 2011 16:53:22 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[ActionScript]]></category> <category><![CDATA[ActionScript3]]></category> <category><![CDATA[HaXe]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[Javascript]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=187</guid> <description><![CDATA[The stream of tweets this week revealed that Flash Player 11 is out&#8230; awesome! Maybe they implemented some really cool new features that I would like to play with&#8230;. hmmm&#8230;. the list looks small&#8230; bummer! In all seriousness, I think the new 3D stuff is awesome, it&#8217;s going to be really amazing. If we can [...]]]></description> <content:encoded><![CDATA[<p>The <a
href="http://twitter.com/#!/search/fp11">stream of tweets</a> this week revealed that Flash Player 11 is out&#8230; awesome! Maybe they implemented some really cool new features that I would like to play with&#8230;. hmmm&#8230;. the list looks small&#8230; bummer!</p><p>In all seriousness, I think the new 3D stuff is awesome, it&#8217;s going to be really amazing. If we can somehow utilise it for user interfaces then we&#8217;re off to a winner! That&#8217;s one of the major issues that I had and still have is that when it comes to rendering it just doesn&#8217;t cut the mustard. Hopefully this will change and it will give one less thing for me to bitch about. It&#8217;s sort of a love hate relation ship I have with the ecosystem that is Flash. One things for certain, I&#8217;m really thinking of leaving it and moving on to Java/Scala and even dare I say it Javascript (probably using <a
href="http://haxe.org">haXe</a> if anything)! Why I hear you cry, here be a list:</p><ul><li><strong>ECMA 4</strong> &#8211; I&#8217;m guessing Adobe are still in the spoils of the ECMA fallout, where Adobe aren&#8217;t 100% sure what to do. If that&#8217;s not the case, this is what is perceived from the dwindling hordes of developers. Is Adobe following ECMA Harmony or are they doing their own thing? The latest FP11 doesn&#8217;t look like it&#8217;s done any sort of move in any direction. The great rival that has appeared in the last couple of years (Javascript) seems to moving lightening fast, ok maybe they&#8217;re not all singing from the same hymn sheet, but at least they&#8217;re moving when it&#8217;s concerning the language (probably excluding MS here somewhat). Things that look appealing to me from a Javascript point of view or even <a
href="http://www.ecma-international.org/activities/Languages/Language%20overview.pdf">original ECMA 4 document</a>, which I believe should be in FP11. Even if there is no official ECMA 4 now, at least have the balls to follow it through!<br
/></p><ul><li>Union types and the set of predefined union types</li><li>Type definitions</li><li>Subtypes</li><li>&#8220;like&#8221;</li><li>yield</li><li>let</li><li>Iterators</li><li>Map</li></ul></li><li><strong>Enums</strong> &#8211; Why can ActionScript 3 not get enums, they&#8217;re basic simplicity that help reduce boiler plate.</li><li><strong>Abstract Classes</strong> &#8211; With all the functionality that ActionScript 3 is getting, it becomes a necessity to have more help from a language and I consider Abstract Classes part of that. Why can&#8217;t the compiler tell me I should override a class if I mark something as Abstract, hell it moans about something when I don&#8217;t override something which I should, it&#8217;s not like a massive leap?</li><li><strong>Private constructors</strong> &#8211; Why did we remove these again?</li><li><strong>Generics</strong> &#8211; Generics in ActionScript 3 is just decent, not good and not excellent, it&#8217;s just decent. It&#8217;s like they went, &#8220;we want to implement generics, but we don&#8217;t have the time. I know, lets implement it in a half arsed way!&#8221;</li><li><strong>Const</strong> &#8211; How about const keyword, is it implemented? Who knows? It&#8217;s not implemented in the Flash IDE, but is implemented the Flex SDK compiler, but you can create a swc file from the Flex SDK and use it in the Flash IDE? How have they managed to do this without changing the player or the Flash IDE? Well it turns out they only do a compile time (better than not I suppose!) and once the check is done, they use the var AVM2 Bytecode instead.</li><li> <strong>Flex compiler</strong> &#8211; Why oh why is the Flex compiler aka mxmlc and compc two separate entities and why oh why do they not implement some really basic rules of optimisations.<br
/></p><ul><li>Inlining</li><li>Constant propagation</li><li>Tail recursive optimistations</li></ul></li></ul><p>I really do hope this stuff is coming, because I think it really is make or break time. People that didn&#8217;t want to invest that much into Actionscript 3 are now moving or have moved on to other languages (Javascript). The people that are still riding it out for better language expressiveness to get down in code what&#8217;s on the tip of their fingers are thinking about it or <a
href="http://blog.joa-ebert.com/">have already done so</a>!</p><p><strong>Edit:</strong><br
/> I was speaking with various colleagues about this thread and <em>we</em> all tended to agree, that most of this is syntax sugar. We use this language day in day out, I&#8217;ve invested a lot of time into this language and it would be helpful if this language could help us out as well.</p><p>You may as an observer say well this looks like language A or like B, I would love to work in A or B, but I&#8217;m on a project that requires AS3 and we don&#8217;t have to option to move to A or B. In the future though I think A or B is on the horizon, especially in these fast moving times.</p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/07/14/eleven-exactly-one-louder/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>AS3-Libraries</title><link>http://www.simonrichardson.info/2011/06/23/as3-libraries/</link> <comments>http://www.simonrichardson.info/2011/06/23/as3-libraries/#comments</comments> <pubDate>Thu, 23 Jun 2011 17:52:49 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[Uncategorized]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=178</guid> <description><![CDATA[My list of libraries are growing, not only have I got AS3-Mixins and AS3-DOM I&#8217;ve started to gather pass and add lots of new AS3 libraries with a liberal license (MIT). Quick overview: AS3-Actions &#8211; AS3 Actions is a beefed up undo manager AS3-Stream &#8211; AS3 Stream came about as the backing for AS3-Actions library [...]]]></description> <content:encoded><![CDATA[<p>My list of libraries are growing, not only have I got <a
href="https://github.com/stickupkid/as3-mixins">AS3-Mixins</a> and <a
href="https://github.com/stickupkid/as3-dom">AS3-DOM</a> I&#8217;ve started to gather pass and add lots of new <a
href="https://github.com/stickupkid">AS3 libraries</a> with a liberal license (<a
href="http://en.wikipedia.org/wiki/MIT_License">MIT</a>). Quick overview:</p><ul><li><strong>AS3-Actions</strong> &#8211; AS3 Actions is a beefed up undo manager</li><li><strong>AS3-Stream</strong> &#8211; AS3 Stream came about as the backing for AS3-Actions library to help with serialization, but has found it&#8217;s uses in other libraries</li><li><strong>AS3-Logger</strong> &#8211; Another logger! You have to make one, as no other logger does what you want!</li><li><strong>AS3-Transitions</strong> &#8211; The main aim of this library is that it&#8217;s simple and fast, use other Tween libraries if you want features!</li><li><strong>AS3-UISignals</strong> &#8211; AS3 UISignals is a library to help deal with the ever changing interfaces which we have to build for. This helps manage touch, mouse and gesture events for components</li><li><strong>AS3-UIComponents</strong> &#8211; This is the front face/GUI to UISignals, currently it&#8217;s in it&#8217;s early stages and is just a series of buttons, analog inputs</li><li><strong>AS3-Spod</strong> &#8211; The name is stolen from haXe, which is Simple Persistent Objects Database Library. The aim to help with SQLite databases. Because writing SQL is just plain boring!</li></ul><p>I&#8217;ll be investing most of my time in the components and improving them <img
src='http://www.simonrichardson.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/06/23/as3-libraries/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>AS3-DOM Example</title><link>http://www.simonrichardson.info/2011/06/03/as3-dom-example/</link> <comments>http://www.simonrichardson.info/2011/06/03/as3-dom-example/#comments</comments> <pubDate>Fri, 03 Jun 2011 17:02:29 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[ActionScript]]></category> <category><![CDATA[ActionScript3]]></category> <category><![CDATA[performance]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=151</guid> <description><![CDATA[Today I managed to get some free time at lunch to implement a very quick example of what is possible with AS3-DOM. There isn&#8217;t much really to it, all it does is sort through a series of Layers (DOMNodes) and then animate them to a new position. It&#8217;s amazingly quick for a first example and [...]]]></description> <content:encoded><![CDATA[<p>Today I managed to get some free time at lunch to implement a very quick <a
href="https://github.com/stickupkid/as3-dom-examples/tree/master/examples/filter-example/org/flash/dom/examples/filter">example</a> of what is possible with AS3-DOM. There isn&#8217;t much really to it, all it does is sort through a series of <a
href="https://github.com/stickupkid/as3-dom-examples/blob/master/examples/filter-example/org/flash/dom/examples/filter/elements/Layer.as">Layers</a> (<a
href="https://github.com/stickupkid/as3-dom/blob/master/src/org/osflash/dom/element/DOMNode.as">DOMNodes</a>) and then animate them to a new position. It&#8217;s amazingly quick for a first example and I was more than impressed with the results! As this is release 0.0.1 alpha there is a lot to improve, especially the need to create an object pool for the expressions. Maybe I&#8217;ll get some free time next week to implement this&#8230;</p> <object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FilterExample" width="580" height="580" name="FilterExample"><param
name="movie" value="http://www.simonrichardson.info/wp-content/uploads/2011/06/FilterExample.swf" /><param
name="name" value="FilterExample" /> <!--[if !IE]>--> <object
type="application/x-shockwave-flash" data="http://www.simonrichardson.info/wp-content/uploads/2011/06/FilterExample.swf" width="580" height="580" name="FilterExample"> <!--<![endif]--> <!--[if !IE]>--> </object> <!--<![endif]--> </object><p> View the <a
href="https://github.com/stickupkid/as3-dom-examples/tree/master/examples/filter-example/org/flash/dom/examples/filter">source code</a></p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/06/03/as3-dom-example/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>AS3-DOM Update</title><link>http://www.simonrichardson.info/2011/06/01/as3-dom-update/</link> <comments>http://www.simonrichardson.info/2011/06/01/as3-dom-update/#comments</comments> <pubDate>Wed, 01 Jun 2011 18:13:45 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[ActionScript]]></category> <category><![CDATA[ActionScript3]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=141</guid> <description><![CDATA[This is a very small update about the AS3-DOM project. The project has under gone some massive updates in the last couple of days, including the syntax. I was running in to a lot of problems trying to work out an easy way to parse methods and groups for if statements, but was just hitting [...]]]></description> <content:encoded><![CDATA[<p>This is a very small update about the AS3-DOM project. The project has under gone some massive updates in the last couple of days, including the syntax. I was running in to a lot of problems trying to work out an easy way to parse methods and groups for if statements, but was just hitting a brick wall. So I took the plunge and ripped out the implementation part of the DOMPath compiler and put in a new one. The great thing with the new one is that it&#8217;s already surpassed the old one in terms of speed, readability and syntax which can be used. The reason it was actually so easy to do this was because I started the path part of the project in a more Test Driven Development way. There is a lot of open discussion about TDD, but I can say at the moment that I&#8217;m sold on it for this type of project and possibly for work, but I would need to try it out whilst working with others. You can see some of the tests in the public repo <a
href="https://github.com/stickupkid/as3-dom">here</a> and the syntax which can be used.</p><p>I&#8217;m currently experimenting with the fusing of the DisplayList and the DOM and currently looks like I&#8217;ve got two approaches. More on this when I&#8217;ve got a solid test setup to verify this.</p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/06/01/as3-dom-update/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>AS3-Mixins update &amp; AS3-DOM introduction</title><link>http://www.simonrichardson.info/2011/05/26/as3-mixins-update-as3-dom-introduction/</link> <comments>http://www.simonrichardson.info/2011/05/26/as3-mixins-update-as3-dom-introduction/#comments</comments> <pubDate>Thu, 26 May 2011 17:31:47 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[ActionScript]]></category> <category><![CDATA[ActionScript3]]></category> <category><![CDATA[performance]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=138</guid> <description><![CDATA[This is just a really quick update on a couple of projects I&#8217;ve got going: AS3-Mixins I&#8217;ve been fortunate to have some free time recently (no idea how or where from!), but I&#8217;ve managed to get AS3-Mixins to a stable enough state so that it can be used without it break everywhere. There are a [...]]]></description> <content:encoded><![CDATA[<p>This is just a really quick update on a couple of projects I&#8217;ve got going:</p><p><strong>AS3-Mixins</strong><br
/> I&#8217;ve been fortunate to have some free time recently (no idea how or where from!), but I&#8217;ve managed to get AS3-Mixins to a stable enough state so that it can be used without it break everywhere. There are a few notable improvements over the first initial creation of the project. It&#8217;s gone through a massive re-factor, with the aim to improve the speed of mixin creation at startup. Most of the work has also been looking into improving memory consumption and I spent a lot of time caching bytecode and types from flemit and the mixins project. There is still a bit to do in this area, but it&#8217;s a lot more efficient that it&#8217;s ever been.</p><p>I&#8217;ve also added the ability for method overloading from a super class, added the ability to use a mixin in a MixinFactoryPool and tons more. This was mainly aimed at the creation of say tiles in a game, so at the start of a level you can create a series of titles/enemies/etc and reuse them without worrying about how to store them or reuse them. It&#8217;s a strongly type factory so it knows what mixin belongs to which pools. There is even a debug helper class which you can use to find out how healthy the MixinFactoryPools are i.e. you can monitor how full the pools are and when they&#8217;re about to be grow because the pools will be exhausted. All very useful for development.</p><p><strong>AS3-DOM</strong><br
/> Another project I&#8217;ve started (told you I&#8217;ve got some spare time!) is the creation of a DOM system in AS3. With the aim to provide a very easy selection tool for user interfaces (or anything else you can thing of using it with). It&#8217;s basically in it&#8217;s infancy, but it&#8217;s going to be something like xpath for AS3. It&#8217;s not going to be the same as xpath, as I&#8217;ve not got the time nor the inclination to write every single xpath rule and it would take far too long and I&#8217;m sure you could get paid for doing that! One added bonus is that the xpath selection can actually work on the DisplayObject list. The down side is you have to convert the DisplayObject list to the DOM. I may look at away to make a better adapter for this, but for now a help function should suffice.</p><p>You can view all of this at my <a
href="https://github.com/stickupkid">github repo</a></p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/05/26/as3-mixins-update-as3-dom-introduction/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>AS3-Mixins: Introduction</title><link>http://www.simonrichardson.info/2011/05/05/as3-mixins-introduction/</link> <comments>http://www.simonrichardson.info/2011/05/05/as3-mixins-introduction/#comments</comments> <pubDate>Thu, 05 May 2011 17:45:24 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[ActionScript]]></category> <category><![CDATA[ActionScript3]]></category> <category><![CDATA[as3-mixins]]></category> <category><![CDATA[as3-signals]]></category> <category><![CDATA[signals]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=127</guid> <description><![CDATA[It all began when I started reading a book about scala and Traits and wondering about how it would be possible to bring it to AS3. Mixin/Traits are away to provide multiple functionality to one or more subclasses, which becomes extremely powerful. This is an example of how I would like my take of mixins [...]]]></description> <content:encoded><![CDATA[<p>It all began when I started reading a book about scala and <a
href="http://www.scala-lang.org/node/126">Traits</a> and wondering about how it would be possible to bring it to AS3. Mixin/Traits are away to provide multiple functionality to one or more subclasses, which becomes extremely powerful.</p><p>This is an example of how I would like my take of mixins to work in AS3. I&#8217;ve simply created a interface called IPosition, it will hold x and y positions.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td
class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org<span style="color: #000066; font-weight: bold;">.</span>osflash<span style="color: #000066; font-weight: bold;">.</span>mixins<span style="color: #000066; font-weight: bold;">.</span>support
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> interface IPosition
    <span style="color: #000000;">&#123;</span>
        <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">x</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">x</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">y</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">y</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div><p>Next we create an implementation that will for fill the interfaces.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td
class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org<span style="color: #000066; font-weight: bold;">.</span>osflash<span style="color: #000066; font-weight: bold;">.</span>mixins<span style="color: #000066; font-weight: bold;">.</span>support<span style="color: #000066; font-weight: bold;">.</span>impl
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> org<span style="color: #000066; font-weight: bold;">.</span>osflash<span style="color: #000066; font-weight: bold;">.</span>mixins<span style="color: #000066; font-weight: bold;">.</span>support<span style="color: #000066; font-weight: bold;">.</span>IPosition<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> final <span style="color: #9900cc; font-weight: bold;">class</span> PositionImpl implements IPosition
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _x <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _y <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> PositionImpl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            _x = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
            _y = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">x</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span> <span style="color: #000000;">&#123;</span>    <span style="color: #0033ff; font-weight: bold;">return</span> _x<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">x</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>    _x = <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">;</span>    <span style="color: #000000;">&#125;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">y</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span> <span style="color: #000000;">&#123;</span>    <span style="color: #0033ff; font-weight: bold;">return</span> _y<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">y</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">int</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>    _y = <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">;</span>    <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div><p>Then finally we would need a implementation of the final subclass where all the mixins are provided. Notice I&#8217;ve also created a ISize, which is relatively the same as IPosition, but uses width and height rather than x and y.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td
class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org<span style="color: #000066; font-weight: bold;">.</span>osflash<span style="color: #000066; font-weight: bold;">.</span>mixins<span style="color: #000066; font-weight: bold;">.</span>support
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> interface ISquare <span style="color: #0033ff; font-weight: bold;">extends</span> ISize<span style="color: #000066; font-weight: bold;">,</span> IPosition
    <span style="color: #000000;">&#123;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div><p>I did a google search on traits and it sent me to a <a
href="http://stackoverflow.com/questions/2577574/mixin-or-trait-implementation-in-as3">stackoverflow</a> page, where <a
href="http://stackoverflow.com/users/16744/brian-heylin">Brian Heylin</a> was asking the same question that I was thinking. This page lead to the working prototype he had created using <a
href="http://asmock.sourceforge.net/">AS Mock</a>. In AS Mock it dynamically adds dependencies with alternative implementations, but it does this in a really clever way. Rather than overloading the prototype system, this injects bytecode at runtime. The great thing about doing this, is that you can design to interfaces, you get strong typing and most of all you get performance when the objects have been created.</p><p>So I created <a
href="https://github.com/stickupkid/as3-mixins">as3-mixins</a>. It&#8217;s a separate project from the prototype because I wanted to be able to grow this into what I wanted. Get it whilst it&#8217;s hot, I&#8217;m going to working on a lot of things, but I&#8217;m currently looking at improving the performance of the creation of the bytecode at the moment. The project that actually handles the bytecode creation and runtime SWF generation is a project called <a
href="https://github.com/stickupkid/flemit">flemit</a>. I&#8217;ve only just started on refactoring this, but I&#8217;ve already started to rip out bits that are surplus to requirements. The end result might be that flemit gets consumed by as3-mixins. I&#8217;m hoping the two can be separate, but that depends if I make flemit so unusable to others that it actually makes no sense as another separate entity.</p><p>Hopefully I&#8217;m going to be able to work on this more, blog post about how the internals work. It&#8217;s actually relatively simple if a little long winded. And just so you know this is an example of how you would create a ISquare implementation.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td
class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> mixin <span style="color: #000066; font-weight: bold;">:</span> IMixin = <span style="color: #0033ff; font-weight: bold;">new</span> Mixin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
mixin<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span>IPosition<span style="color: #000066; font-weight: bold;">,</span> PositionImpl<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
mixin<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span>ISize<span style="color: #000066; font-weight: bold;">,</span> SizeImpl<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
mixin<span style="color: #000066; font-weight: bold;">.</span>define<span style="color: #000000;">&#40;</span>ISquare<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
mixin<span style="color: #000066; font-weight: bold;">.</span>generate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>completedSignal<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span><span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>mixin<span style="color: #000066; font-weight: bold;">:</span>Mixin<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
                                        <span style="color: #000000;">&#123;</span>
                                            <span style="color: #6699cc; font-weight: bold;">var</span> square <span style="color: #000066; font-weight: bold;">:</span> ISquare = mixin<span style="color: #000066; font-weight: bold;">.</span>create<span style="color: #000000;">&#40;</span>ISquare<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
                                            square<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000066; font-weight: bold;">;</span>
                                            <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;I have a square!&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
                                        <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/05/05/as3-mixins-introduction/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>SingleSignal</title><link>http://www.simonrichardson.info/2011/03/31/singlesignal/</link> <comments>http://www.simonrichardson.info/2011/03/31/singlesignal/#comments</comments> <pubDate>Thu, 31 Mar 2011 11:05:02 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[ActionScript]]></category> <category><![CDATA[ActionScript3]]></category> <category><![CDATA[performance]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=114</guid> <description><![CDATA[Recently we&#8217;ve been working on a project for a limited device and have been concentrating on the performance aspects of the application. We use signals quite extensively in the project application (to good effect!), but it does intrigue me when you come to any stage of application development, that there are certain things you know [...]]]></description> <content:encoded><![CDATA[<p>Recently <a
href="http://www.ustwo.co.uk">we&#8217;ve</a> been working on a project for a limited device and have been concentrating on the performance aspects of the application. We use signals quite extensively in the project application (to good effect!), but it does intrigue me when you come to any stage of application development, that there are certain things you know about the application and what it does and when. When looking at Signals specifically these things are:</p><ol><li>You know when something needs to listen to a Signal</li><li>You should know how many times your registering to said Signal</li></ol><p>I&#8217;m more interested in number 2 for now. As the application is ironed out over time, it makes me wonder why we&#8217;ve got this extra functionality of allowing multiple listeners to registered to a Signal, when only one suffices. I&#8217;ve never been a fan of hooking on to direct callbacks, mainly for the reason that you don&#8217;t know what is coming through as the arguments and the added bonus of reading the documentation every time. I&#8217;m more interested in self documenting code, not that I&#8217;m against documentation! I just want to be able at a glance to understand what the code does (where possible of course).</p><p>I had thought about implementing a SingleSignal. The whole purpose of this is to provide away to have a one listener at a time callback. The SingleSignal had to satisfy the following:</p><ol><li>Only register one listener at a time</li><li>Notify the developer if they tried to register more than one listener</li><li>Be faster than the default Signal, as we&#8217;ve not got the over head of the linked list and Dictionary</li><li>Use less memory than the default Signal</li></ol><p>It didn&#8217;t take me long to implement the functionality of the SingleSignal, as I already had the excellent work of Robert Penner and Joa Ebert to start from. The current implementation is in my <a
href="https://github.com/stickupkid/as3-signals/blob/master/src/org/osflash/signals/SingleSignal.as">github repo</a>. I&#8217;ve also created some unit tests to help improve the robustness and prevent errors slipping through.</p><p>The last thing I did was verify the performance using the existing <a
href="https://github.com/robertpenner/as3-signals/tree/master/performance-test/org/osflash/signals">performance testing in the repo</a>. Here are the results from a release Flash Player (10.1r85.3) on a mac running 10.6.2:</p><p><strong>AddOncePerformance</strong><br
/> Note: All tests min time was 0ms for all.<TABLE><TR><TH></TH><TH>DeluxeSignal</TH><TH>Signal</TH><TH>SingleSignal</TH></TR><TR><TD>Frames per second (fps):</TD><TD>49fps</TD><TD>60fps</TD><TD>60fps</TD></TR><TR><TD>Memory used:</TD><TD>6mb</TD><TD>6mb</TD><TD>4mb</TD></TR><TR><TD>Max time:</TD><TD>8ms</TD><TD>7ms</TD><TD>4ms</TD></TR></TABLE></p><p><strong>RemovePerformance</strong><br
/> Note: All tests ran at 60fps and the min time was 0ms for all.<TABLE><TR><TH></TH><TH>DeluxeSignal</TH><TH>Signal</TH><TH>SingleSignal</TH></TR><TR><TD>Memory used:</TD><TD>6mb</TD><TD>6mb</TD><TD>4mb</TD></TR><TR><TD>Max time:</TD><TD>6ms</TD><TD>6ms</TD><TD>4ms</TD></TR></TABLE></p><p>There you have it. It&#8217;s up to 33% faster, which won&#8217;t be that noticiable, depends on how many addOnce or add and dispatches you&#8217;re doing. It also uses 2mb less, which is a good improvement overall. So if you know what the restrictions are of your application and you know you&#8217;re going to add one listener and you want to use less memory then a SingleSignal might be for you&#8230;</p><p><strong>EDIT:</strong> slight refractor to make the article more concise.</p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2011/03/31/singlesignal/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Signals MVC</title><link>http://www.simonrichardson.info/2010/12/30/signals-mvc/</link> <comments>http://www.simonrichardson.info/2010/12/30/signals-mvc/#comments</comments> <pubDate>Thu, 30 Dec 2010 16:36:18 +0000</pubDate> <dc:creator>Simon Richardson</dc:creator> <category><![CDATA[ActionScript]]></category> <category><![CDATA[ActionScript3]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[pureMVC]]></category> <category><![CDATA[signals]]></category> <category><![CDATA[signalsMVC]]></category> <guid
isPermaLink="false">http://www.simonrichardson.info/?p=109</guid> <description><![CDATA[Over the Christmas period I normally get a bit of free time, it&#8217;s not much but I can normally prototype a library/framework/demo which I&#8217;ve been thinking about at work. Well this Christmas is no different. I&#8217;ve moved my internal framework to Signals, removing the need for me to keep handles on my listeners. I&#8217;ve now [...]]]></description> <content:encoded><![CDATA[<p>Over the Christmas period I normally get a bit of free time, it&#8217;s not much but I can normally prototype a library/framework/demo which I&#8217;ve been thinking about at work. Well this Christmas is no different. I&#8217;ve moved my internal framework to Signals, removing the need for me to keep handles on my listeners. I&#8217;ve now off loaded it to Signals, which means there is less things to manage (management, optimisation, etc) when the concerned class shouldn&#8217;t care about these things. The great thing about Signals is the callback arguments are strongly typed, unfortunately we at ustwo&trade; use <a
href="http://puremvc.org">pureMVC</a> as the framework of choice. The one problem we have with pureMVC is the fact that the event bus used is not strongly typed. In fact you pass anything in the notification body. This is fine if you&#8217;re the developer coding the item, but if you&#8217;re part of a large team, it becomes incredibly hard to keep track of what&#8217;s being sent where. Recently we&#8217;ve had the idea of using Signals for the event bus, so I took the time to implement this. I finished a working version, that sat on top of the pureMVC framework. It was great a signals mvc that work along side pureMVC event bus. You could even send notifications that hooked into the signals. Signals had priority over notifications when sending, so if you list the signal hooks it would be called before notifications every time. There was no way to change this, literally because the two event busses where completely polls apart.</p><p>So over Christmas I completely re-wrote the pureMVC into signalMVC which is nearly identical to pureMVC except for a few exceptions:</p><ul><li>Signal event bus &#8211; you make your interests in the mediator using IHooks, these are strongly typed classes.</li><li>Removed singletons &#8211; these have become a big hinderance in the past. This has the consequence of removing the multicore code base.</li></ul><p>You can view all the code here &#8211; <a
href="https://github.com/stickupkid/ui-signals-mvc">https://github.com/stickupkid/ui-signals-mvc</a></p> ]]></content:encoded> <wfw:commentRss>http://www.simonrichardson.info/2010/12/30/signals-mvc/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Dynamic page generated in 0.793 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-06 07:59:47 -->
<!-- Compression = gzip -->
