Archive for the ‘flex’ Category

Suffering from Disappearing import statements and lack of auto fill in flex SDK 3.2?

Wednesday, March 4th, 2009

I’m posting this because apparently I’m not the only moron experiencing such misery.

Since the release of FlexBuilder SDK 3.2 (supports flash player 10), I’ve been tearing the few remaining hairs off my scalp due to (mostly) the Incredible Disappearing BitmapData import. Today I updated to SDK build 3.3 and I was horrified to discover the import/auto fill features seemed to get even worse! So I twittered about it, and sure enough, the solution was in my tweetdeck within minutes:

Just update your flexbuilder to 3.0.2

Which you can do by clicking on Help/Search For Flexbuilder Updates…

A few hundred megabytes later everything works like a dream again. Thanks Alain.

That is all.

FlexCamp Belgium Summary, Slides And Source Code

Friday, December 12th, 2008

We had a pretty good turnout yesterday, it was great to see (and meet) a lot of new faces! I naturally started the event by going to the wrong SISA building, but fortunately the ‘real’ one was just a few minutes away.

Here are some of the highlights:

James Ward went over some of the new tags, namespace changes and general updates in Gumbo. Amongst other things, he covered the new 3d implementation, pixelbender integration, FXG, skins and new text features.

Chet Haase talked about his recent work in the frameworks animation capabilities. The Tween class is now replaced by a lower level ‘Animator’ (or was it Animation?) Class, and the implementation was like music to my ears! He also went on the explain the higher level implementations of Effects… very cool…

Peter Elst delivered an interesting overview of the SQLite Features in Air1.5 in his typically coherent and well organized manner, always a pleasure :)

Mr. Spring ActionScript : Christophe Herreman discussed a bit of Inversion Of Control Theory, then went on to showcase his current project, how Spring ActionScript was is implemented in it and what the benefits are. I have to admit that although each time I read about the topic I understand a little bit more, yet, parts of it still flew way over my head. It’s a fascinating framework, and I have a great deal of respect for Christophe! He posted a very comprehensive summary of his presentation this morning on his blog.

Finally, my own presentation. Again, I’m not sure what Koen was thinking when he put me on as the last speaker… Talking about Invalidation Routines at 21:45 in the evening was, well, challenging ;) Having said that, the presentation went smoothly, generated some laughs and I received positive feedback at the end, including the “If only you could have told me this one year ago” :D

Here be the slides:

…and probably more interesting, you can download the Flex project with all the source code here

Thanks again, and see you all at the next user group event!

Talking invalidation at FlexCamp08 Belgium

Monday, December 8th, 2008

Koen was kind enough to invite me to speak the FlexCamp at Sisa Antwerp. Given just 10 days headsup, I decided to go with my “Invalidation Routines Pounded into your cranium once and for all!” which I gave at the 360Flex earlier this year in Milan. If you are building Flex Components, and are not 100% clear on the uses and implementation of measure(), commitProperties() and updateDisplayList() are, then this is a must see. The original presentation was 90 minutes, this time it’s compressed to just 30, but I’ll still try to fit time to “dig a bit deeper” to keep it interesting for even the Flex Masters out there. I still see people getting this wrong, so I figure it’s a useful presentation. Apparently the event is pretty much sold out, so if you’re not one of the lucky ones, you can try the scalpers outside the door or by bribing Koen ;)

Also, a wonderful case of “ask and thou shall receive”, Christophe Herreman blogged about the release of the Spring ActionScript last week, I asked if he might demo it at the FlexCamp, and within a few hours he was on the speaker list! I’m really looking forwards to that one!

See you there!

Trying out fp10 3d features partII : Z sorting, truly simple shader, nested perspective

Wednesday, October 22nd, 2008

Continuing on with the basics, heres a few more tests. Just to clarify from last time, all of this is achieved using only the x,y,z, rotationX, rotationY and rotationZ properties of plain old Sprites. This is what I find so awesome about the new flashplayer10 as3 features.

Sure, the performance and rendering capabilites are no match for what developers have at their hands in games consoles etc. (this is nothing new or surprising). What I’m really digging is that anyone with a basic understanding of display object programming in as3 can jump into doing fairly cool 3d. Just grab your bag of flash tricks and take them to another dimension (har har ;) ). Seriously, everything works more or less exactly as I wanted / expected, and is a real pleasure to code. Reminds me of of the enthusiasm when I was learning to program with flash5 and 6. :thumbsup:

Anyway. Moving on, z-Sorting :.

screenshot of cube with simple z sorting

There is this ROCKING little method:

[Sprite].transform.getRelativeMatrix3D(parent).position.z;

Here’s what it does:

  • In the case of the cube. I created a parent Sprite, called “cube”.
  • In it, I created 6 nested Sprites with a square graphic. I moved, and rotated these into positions which constitute a cube.
  • Rotating the parent “cube” (with rotationX,Y and Z) results in what you see in “3) CubeTest”.
  • To sort these sides, all I need to do is run the afore mentioned function, which returns the current z position of the nested clips.
  • With this knowledge, it just takes a simple loop to sort the display list. See an example here.

Simple shading:


screenshot of cube with simple z sorting and simple shading

Using that same Z value which I used to sort out the sides of the square, I just added a dark layer on top of each “side button”. On every render, I set its trasparency equal to a proportionate value of Z and the maximum and minimum z (possible for the sides of the rotated cube). It’s not phong or gouraud shading, but it’ll fool the novice :) Again, a real “flash” feeling.

Same thing but with a bitmap material (read simple sprite).


screenshot of cube with simple z sorting, simple shading using bitmap materials

Nested Perspective:

No rocket science here either, just curious how changing the z of a nested clip would act out…


screenshot of nested perspective menu test

With a little more work, I think something like the Vaio10 menu could be achieved. Same goes for the cube menu above and the Pioneer Kuro Project menu.

As a matter of fact, I can think of several popular papervision menus which can be reproduced using very basic flashplayer 10 AS3 features. I’m guessing this is more than welcome news to the more “designer flashers” as opposed to the “programmer flashers” (who also get their share of new FP10 features, which I’ll be exploring in upcoming posts). All good :)

As promised, here are the sources. This is a Flex project, in order to work with it (at the time of writing), just follow these simple steps:

  1. Download a nightly build of the Flex3 sdk (or gumbo) dating later than May. (more details)
  2. Copy the sdk into your flexbuilder sdks folder and create a Flexbuilder project, adjusting the preferences so that the compiler targets flashplayer10 and the new sdk. It’s dead easy, see details here.

Again, here is the link to the test app

I would love to hear/see of anyone that decides to use this “test set up”. Enjoy!

Trying out flash player 10 3d features

Thursday, October 16th, 2008

Nascom was kind enough to let me spend some work hours investigating the new features of flash player 10. Naturally the first step was to check out the 3d features. I built a quick “testing” environment. Each test is pretty self explanatory, but if that’s not enough, I included some notes attached to each experiment in the flex app. Behold the first 3 tests (but install player 10 first)…

Be sure to drag the vanishing point…

basic flash player 10 3d behaviour

The frame rate is not bad, even with a ton of shapes:

basic flash player 10 3d performance test

Creating a cube… lookout papervision ;)

flash player 10 3d cube test with color materia

Ok, so the cube was not so impressive due to the “layered” nature of flash player10 3d. I’m convinced that through the “hackish” nature of the flash community, there will soon be enough “clever” implementations that will be small in filesize, but will fool the eye. Remember, these cubes can be created and tweened on the timeline… Here’s a slightly more convincing “wireframe” version :


flash player 10 3d cube test with wireframe material

try out the flash player 10 3d test runner

More tests coming soon. I’ll be posting the code as well.