Browsing the blog archives for February, 2008.

Actionscript 4 specifications preview

actionscript 4

The Task Group behind ECMAScript is working on the 4th release of the language specifications.

Most of you will now that Actionscript is a ECMAScript based just like javascript, so the new specifications will influence AS4 too.

I found two very interesting links about this topic on the relative post @ Beedigital.net.

The first link is:
Proposed ECMAScript 4th Edition – Language Overview

It’s a full 40 pages PDF document about language specifications, so it’s quite heavy but just in the very first page there’s a interesting information about the actual status of the language specifications:

This document reflects the understanding of the language as of October 2007. TG1 is no longer accepting proposals and has started writing the language specification. The ES4 reference implementation is undergoing stabilization and is already passing large parts of its test suite, and this document describes the final language in most respects. That said, TG1 maintains a bug tracking system at http://bugs.ecmascript.org/, and ES4 is subject to further refinement as known and new bugs in the design are resolved.

latter on page 4:

The current Task Group 1 of Ecma Technical Committee 39 (Ecma TC39-TG1, hereinafter TG1) has met
since the fall of 2005, basing their work on ES3, the interim ES4 report, and experiences with Adobe’s and
thMicrosoft’s implementations. TG1 expects to complete the 4 Edition Specification in the fall of 2008.

So everything let us believe AS4 is quite near.

The second link posted by Beedigital.net is some lecture notes from Colin Moock, he will be explaining at the FITC 200 in February an April.

These lecture notes are mainly excerpts from the overview document, showing a lot of interesting code examples and is much more reader friendly.

I found a lot of the new stuff very interesting and my personal tops are:

  1. array type
  2. operator overloading
  3. generators
  4. Vector class
  5. destructuring assignment
  6. triple-quoted strings
  7. lexical block scoping

and other minors features too (mainly mutuated from python) like:

  • string indexing
  • slicing syntax

(the Mock’s document hasn’t anchors so i cannot link the above list, however just copy/find in page).

The most waited by many people is typed arrays, because let’s say it… 9 out of 10 times you use arrays all the elements are of the same type.
With typed arrays the virtual machine doesn’t need to check every element and everything should gain a lot of speed and make as4 a lot faster than as3 in particles, swarms, lists and bitmapData’s operations.

More on ECMAScript 4 at ecmascript.org with interesting tutorial on Evolutionary programming in ES4.

Let me know your personal favorite new features in a comment if you like.

1 Comment

Fountain equalizer now with source code

Particles, actionscript 3, classes, equalizer

I just edited the Fountain equalizer post adding the source code.
You’ll just need to download the two particles classes and copy the main code.

I received really a lot of requests about the code in the comments and by mail, and I am very pleased about this… means you liked it.

Expect more equalizing fun.

1 Comment

Actionscript 3 - PixelMorphing class first test (morphing with particles)

BitmapData, Particles, actionscript 3, classes, morphing

Hi there,
I am back after some pause with this interesting effect. This class takes every pixel from two pictures, sort them by averaged luminosity e reconstruct the second picture animating pixels from the first one.

The effect is a very nice pixel morphing (particles morphing) and the final result resambles some color ramp recolor tecnique.

pixelmorphing_test.jpg
Start demo

This is the second algorythm I wrote. The first one was build to do the calculation about moving pixels and then draw the full picture parsing the full array of pixels. The bigger problem in the first one was speed of execution.

The setPixel method of the BitmapData class is far too slow for this kind of effect and even slower was the parsing every frame of the full array containing all the pixel of the first image.

So I come with completely new algorythm that uses three bitmaps/bitmapdatas where the first only displays original image and set to trasparent only pixels that have moved away.
The scond one redraws every frame, but only displays moving pixels which are stored in a much shorter array and the last one shows only pixels which reached the final position.

With this second approach only pixels effectively changing are redrawn and a lot of speed can be gained.

This first post is only for showcase, during next days I will write a technical post about class structure, speed optimisations etc. off course with source code.

Don’t forget to leave a comment if you like it ;-)

16 Comments