Archive

Posts Tagged ‘ActionScript 3.0’

AIR 2.0 HTTP Web Server

December 17th, 2009 No comments

AIR 2.0 brings a lot of new features. Among them is the new ServerSocket class. The Socket class exists since Flash 9 and enabled a lot of new client/server applications. But it has always been limited to client side sockets as long as AIR (and the Flash Platform as a whole for that matter) is concerned. Therefor, this new server socket feature makes it possible to build actual server software using AIR!

Rich of this new and incredible ability, Christophe Coenraets posted a small but yet very powerful code snippet to build an HTTP web server using AIR 2.0!

Voice Recognition in Flash 10

December 16th, 2009 No comments

The following video demonstrates a new “voice gesture” library targeting the Flash Platform. As you might have guessed, those “voice gestures” are pretty much like “mouse gestures” but they are activated by voice only. I guess it uses some kind of voice learning/recognition algorithm. I can’t stress enough how trhilled I am to see this kind of new and powerful software coming to Flash. This enables a whole new kind of usages and applications…


Voice Gesture from didier.brun on Vimeo.

Frustum Culling in Flash 10

December 13th, 2009 1 comment

Update: corrected a few glitches in the bounding sphere creation routine.

Optimization is always important. But when it comes to 3D for the Flash Platform, it’s an everyday battle. The first ideas that come to mind are to avoid:

  1. redrawing the same regions : each pixel value must be set once and only once
  2. rendering invisible objects : objects that are out of sight still take a lot of CPU horsepower

While Flash takes care of the first one in its very renderer, the second one is not handled. But that is something we can easily address!

The Technic

The method is called “frustum culling”. The big picture is that every mesh is approximated using a bounding volume (typically a sphere or a box). If the bounding volume is visible, the corresponding mesh is rendered. The two following pictures show the frustum culling caught in action:

The mesh is visible

The mesh is visible: TPS counter indicates 18900 triangles per seconds

Frustum culling in action (TPS counter indicates 0!)

The mesh is out of sight: frustum culling is acting and TPS counter indicates 0!

Code snippets and a live experiment right after the jump!

MadCompany: Coming Soon!

December 10th, 2009 2 comments



Amazon Web Services REST queries signature in ActionScript 3

August 24th, 2009 15 comments

As I was working on a custom MP3 player, I wanted to use a web service to search for album arts in order to display them as the corresponding music is played. After a quic Google search I found Amazon Web Services (AWS). Amazon actually provides services to search items in their catalog and therefor you can look for a precise music album and get its cover. This very service is the Product Advertising and is accessible through the Product Advertising API.

But since the 15th of August 2009 AWS requires every request to be signed. It simply means that a “Signature” parameter must be added to each and every request. One might think that the API key should be enough, but this key is inserted in every query URL and can be read by pretty much anyone. The signature is created using the secret AWS password and crypted using the HMAC/SHA256 algorithms so that AWS can be sure the request actually comes from the genuine owner of the API key.

The documentation features a guide to explain the whole signing process step-by-step but as you might have guesses, there is a huge difference between reading it on the documentation and actually implementing it successfully.

Full code right after the jump…

Read more…

DirectFlex and Flash 10 : what’s next ?

August 26th, 2008 1 comment

My first post was about the 3D Flash library I’m currently working on : DirectFlex. As I said, it is not a simple 3D engine but a full 3D API like DirectX or OpenGL. As Flash 10 is likely to be available when the first public version of DirectFlex will be released, I decided to rewrite the API’s core to take advantage of the new 3D mathematics classes and the hardware acceleration features. This is actually the third time that DirectFlex is entirely rewritten from scratch… but time after time the quality of the work and the performances have improved a lot.

Read more…

DirectFlex : a new Flash 10 3D API

August 21st, 2008 3 comments

The next version of the Flash player will introduce a lot of new cool/useful features. One of them is the brand new 3D API. Of course, a lot of people are talking about the cool new “3D effects” that use this 3D API, but in the end those do not allow “real” and “complex” 3D such as real-time 3D games. So basically, yeah, drawing 3D spinning planes is “cool”, but that’s not how you’re gonna create some “ass-kicking” RIA…

In order to render complex 3D geometry, you’ll have to use the underneath 3D API itself. This 3D API is mainly about three classes : Matrix3D, Vector3D and Utils3D. Those implements data types and methods to transform vertices data from a space to another in order to render actual 3D geometry on our very 2d flat screens. And… that’s it. We also have the new “Graphics.drawTriangles” method and hardware acceleration, but all of this does not provide what we could call a user-friendly 3D API. But here comes…

Read more…