AS3 – Fast memory access without Alchemy

Posted in AS3, haXe on May 3rd, 2010 by Philippe – 11 Comments

With the Flash Player 10, Adobe added a new set of instructions allowing to compile C/C++ in a way the AVM2 could execute. By wrapping a little bit of glue code in C, Alchemy allows to reuse some of the numerous open source C libraries available.

And when you appreciate the speed of Alchemy-compiled C code, you can wonder how it can possibly be so much faster than AS3. Unfair!

What makes Alchemy code so fast? The main secret is a faster memory management, because obviously C/C++ is all about pointers & malloc’ing. ByteArray in AS3 is kind of slow so Adobe had to hack the AVM2 to remove this bottleneck or Alchemy would have been pointless.

And the good news for us AS3 geeks is that it is possible to use this fast memory in AS3…

Continue reading « AS3 – Fast memory access without Alchemy »

AS3 – Eaze tween library update

Posted in AS3, Eaze, library on November 6th, 2009 by Philippe – 46 Comments

Let’s state it again: "tweening" is a commodity with plenty of alternatives, which means you’re not obliged to use a) crappy ones, b) bloated ones, and c) commercial ones.

Like many Flash developers I started developping Eaze because a) it’s fun, b) it’s (mildly) challenging, and c) I really had a few ideas to innovate in this field.

Since then I had the occasion to discuss (I should say brainstorm) with other Flash developers (hi Joshua and Steve) about our "tweening needs" (sounds dirty, isn’t it?) and our idea of the perfect library. This was very entertaining and they all gave me lots of crazy syntax ideas which turned out to be possible…

Continue reading « AS3 – Eaze tween library update »

AS3 – Designing a new tween library

Posted in AS3, Eaze, library on September 25th, 2009 by Philippe – 10 Comments

I don’t want to sound grumpy, but I never liked how more and more coders don’t seem to be able to keep things simple. Looks like nowadays you must be an architecture astronaut to be considered seriously.

One of these basic Flash things which should be kept simple is tweening – everybody needs to animate things, but I believe it should be kept as a commodity and not become fatter than your own application code.

Continue reading « AS3 – Designing a new tween library »

haXe – what’s in it for you

Posted in haXe on August 2nd, 2009 by Philippe – 6 Comments

The haXe community has been buzzing about it for some weeks, and a few days ago you could read in haXe 2.0.4 release notes that the experimental C++ compilation target was now included.

You probably know that haXe can be used as an alternative to AS2 and AS3 for Flash development, but you would definitely be missing something if you limit this powerful language to “just Flash”…

So how did haXe get to be able to compile as C++ and why is it a big thing?

Continue reading « haXe – what’s in it for you »

AS3 – Parametric path drawing

Posted in AS3, geometry on June 20th, 2009 by Philippe – 3 Comments

Partial path drawing Last time I gently coded a script for “rounding” the corners of a path. I think the script is really fine, handles nicely closed paths, but, it’s “static”.

So here’s the new, innocent, question: what if you want to have an animated drawing of the path?

Innocent answer: the drawing method would need a “ratio” parameter, so you can draw only a part of the path.

Continue reading « AS3 – Parametric path drawing »

AS3 – Rounding corners

Posted in AS3, geometry on May 31st, 2009 by Philippe – 5 Comments

Interactive demoA few days ago, I was with a few students from Gobelins talking about their school projects. One group was working on some trip-assistant project where they would display itineraries on a city map.

Map itineraries most of the time are painted as straight lines with square corners and so one student suggested that it would look nicer with rounded corners: easy stuff, I said, just get each segment’s direction vector, multiply by the corner radius you want and lineTo/curveTo the path.

Continue reading « AS3 – Rounding corners »