May 7th, 2010 — 12:04am

I actually took this from production code!
I’ve had it with events in ActionScript 3! They are annoying to structure, annoying to extend, annoying to dispatch but most importantly annoying to consume – and I consume events a lot more than write or dispatch my own.
But! The idea of listening for stuff I really do like. I have some ideas about how this could be done a lot easier. Oh, and please stick around until the very end of this post.
Continue reading »
10 comments » | API, AS3, Programming, Trends
November 4th, 2009 — 12:22pm
I was playing around with E4X last night working on an upcoming blog post about the capabilities of E4X. While playing, I was thoroughly reading the ECMA-357 standard, and found that there are some special rules about assignment and compound assignment, that produce truely unexpected results.
I will try to summarize common pitfalls and provide valid work-arounds.
Continue reading »
Comment » | AS3, E4X
October 9th, 2009 — 11:19am
I finally got the time to clean up the code for MXHR4AS3 – an implementation of the Digg-introduced concept of requesting several files from the server in one request and returning it as a multipart/mixed http response to reduce overhead. The original was implemented in JS, and I have further re-implemented it in AS3.
As promised, the code has been uploaded to Bitbucket. Please enjoy and by all means request access if necessary. Please refer to the new project page here for details.
Comment » | AS3, MXHR4AS3
September 4th, 2009 — 1:32pm
After having read about and experimented with Digg’s MXHR concept and DUI.Stream, I have now implemented the very same thing for ActionScript 3. In my tests it really shows a performance-boost over conventional queued download.
Continue reading »
6 comments » | API, AS3, Trends
July 19th, 2009 — 11:40pm
I have been doing ActionScript 3 projects for quite a while, but every now and then I (as well as many others in the trade) have to switch back to AS2 or even AS1 – the line between them is quite blurry really in retrospective. When doing AS3 projects, there are many features that really come in handy, but it is only when you don’t have them available, that you really find out which are the true improvements, that you cannot live without, and which are just nice little tweaks, that make your everyday scripting easier.
The latter category includes e.g. the for-each-in construct, different number types, class introspection or built-in class look-up by string, but these are my top 6 AS3 features, that I find myself constantly missing when fixing or improving scripts in older versions of ActionScript:
Continue reading »
4 comments » | AS2, AS3, Lists
July 1st, 2009 — 2:34pm
I’ve just discovered a “bug” in the latest Flash Player. Actually the “bug” was in a production, that only worked in the latest player and not in previous players. I’ve boiled it down to this:
If the x- or y-attribute of a DisplayObject is set to NaN, in previous players this caused the attribute to be set to -107374182.4. In the latest player, the attribute is set to 0.
Continue reading »
4 comments » | AS2, AS3
May 21st, 2009 — 8:03pm
For-each-in is quite a secret looping method in ActionScript. It was added in ActionScript 3 in Flash Player 9 (actually in the 8.5 release). It has existed in other languages like PHP for quite some time, and Java has a similar iteration method added in recent years. It is ideal for looping over arrays of similar-typed elements, as it loops over values, not keys.
Continue reading »
7 comments » | AS3
May 19th, 2009 — 1:11pm
I’ve been using tweens a lot recently – for example while developing the small campaign site for the new Peugeot 206+ and Peugeot Blue Drive campaign (in Danish). I used GTween and GTweenTimeline to a great extent to really make it easy for me to implement and update.
Continue reading »
Comment » | AS3, Konstellation
May 6th, 2009 — 2:44pm
This feature does currently not work – see list of updates below
ShareThis is a great service for adding shareability to your website in a very simple way. It even includes the “tip a friend” option, so you don’t need to code that for your own site. I will describe how to embed it from flash.
Note 2009/05/19: Due to changes in the ShareThis API popup-functionality is broken currently (both in my example and in some of my live projects). I have filed a bug with ShareThis to fix this ASAP.
Note 2009/05/21: ShareThis have now fixed the above bug but there is still a minor JavaScript error thrown. The popup works now though as it should from both JS and Flash.
Note 2009/06/08: ShareThis now broke it again. And this time their support staff doesn’t answer. Please see an example implemented with AddThis instead.
Note 2009/06/19: ShareThis finally fixed it again. They wrote a mail on the 17th to me stating the bug was reintroduced when they implemented CDN, but would be fixed in the next release. Let’s hope it stays that way.
Note 2009/08/14: ShareThis has recently implemented a brand new version of their service – and surprise: it is not backwards compatible. Thus my popup example is broken again. I will investigate and fix soon.
Note 2009/08/17: ShareThis has promised to deliver a flash API within a few weeks. Let’s see what happens then…
Continue reading »
13 comments » | API, AS2, AS3, HTML, JavaScript
October 2nd, 2008 — 12:32am
Flash on the Beach is just over and the final day had the most impressive (and the single most useful) presentations. The inspirational level this year has been great. The wonderfully beautiful creations by Eric Natzke or Robert Hodgin can take anyones breath away and the generally inspiring nature of Jonathan Harris’ works makes everyone want to do the same (if only we could get similar great ideas).
But Mario Klingemann’s presentation about reading QR codes in Flash was the most (technically) inspiring presentation in my opinion and I could immediately see a bunch of ways in which, I could use this for all different sorts of purposes – in real life advertising and not just for the fun of it. I really feel that I could join this project and make it into a complete library and so far I’ve written him a mail offering my help (and a minor possibility for optimization).
But credits also go to Grant Skinner, as his talk on important things to learn as a new web developer (in Flash in particular) gave me some good inspiration for my own job as head of development with developers of my own needing help and guidelines.
Comment » | AS3