Category Archives: Flash

Smoothing Cross-Domain Images

In the old days of Flash 7, anytime you scaled or rotated an image it was automatically smoothed. This was regardless of whether the image was embedded or loaded dynamically. Smoothing gives a nice sub-pixel, anti-aliased look to the resultant image. No smoothing gives a jaggedy, crappy-looking resultant image (see example below).

[kml_flashembed movie=”http://www.airtightinteractive.com/flash/smoothing/smoothing.swf” width=”400″ height=”560″ fversion=”9″/]

Now in Flash 9 when you dynamically load an image using the Loader class, smoothing is turned off by default. The recommended way to smooth the image is to copy the content of the loader into a Bitmap object and enable smoothing on it. The problem is that for images that are loaded cross-domain, we don’t have access to the BitmapData, so there is no way to smooth the image.

There are 2 work-arounds that unfortunately don’t work in many use cases:

  • Use a server-side proxy. This is prohibitive for large scale apps in terms of bandwidth costs.
  • Use crossdomain.xml files. Only works if you have access to the server where the image is coming from.

In my opinion, it should be possible to get smoothing on a cross-domain image. There’s 2 ways this could happen:

  • Allow access to cross-domain BitmapData (although apparently this is not going to happen).
  • Add a ‘smoothing’ property to the Loader class. Hopefully Adobe will consider this for a future rev of the player.

[UPDATE]
If you agree that Adobe should add a ‘smoothing’ property to the Loader class for Flash Player 10, please add a feature request here.

Yet Another 3D Ribbon

[kml_flashembed movie=”http://www.airtightinteractive.com/demos/ribbon/Ribbons3D.swf” width=”400″ height=”250″ fversion=”9″ allowfullscreen=”true”/]

Sometimes simpler is better. This is a modified version of my last experiment with only one ribbon. Right-click to go full-screen. I added a nice glow filter plus some color tweening. It looks a bit like 3D graffiti or Japanese calligraphy. I think it would look good projected big on a wall, or as a screensaver. The code was retro-fitted to work with Papervision v1.7, since the v2 alpha does not give access to a DisplayObject3D’s sprites.

3D Ribbons Revisited

Ribbons

I’ve been playing with this 3D bezier code for a while now. I finally got some nice motion happening. Click and drag to rotate the space.

The last time I tried this, the ribbon was actually a 2D bezier curve that was then rotated in 3D. This time I got a hang of the math to create real 3D ribbons.

Source code is here and includes instructions for how to compile it. The code was compiled using Flex Builder 3 and Papervision 2.0 alpha ‘Great White’ rev 387.

Disabling the Maximize Button in AIR

Just figured this out after Google came up short. You can disable an AIR application’s system chrome maximize and minimize buttons by editing the ‘MyApp-app.xml’ file. Uncomment and set your values in the following options:

<minimizable>true</minimizable>
<maximizable>false</maximizable>
<resizable>false</resizable>

There are also a bunch of other options you can configure in here.

I have to say that so far I am loving AIR. Building, debugging and deploying to AIR with FB3 is seamless and fast. You want file system access? Easy. You want encrypted local data? Easy. You want byte-level control over network traffic? Easy. Recently Adobe is really taking it’s dev tools to the next level, especially when you compare against what was available just a few years ago.

Introducing svManager, the Easy Way to Manage your SimpleViewer Galleries

svManager provides a user interface for managing SimpleViewer galleries via a PHP application that runs on your webserver. svManager can be used with the free version of SimpleViewer or with SimpleViewer-Pro. Find out more about svManager here.

Thanks to Jack Hardie for doing a stellar job putting svManager together.

OMG – they put Quake 2 in Flash!!

Scott Peterson has ported Quake 2 Quake to Flash 10 (second video down @ 4:50) via a C++ to AS3 converter. I actually missed this demo yesterday at MAX as I snuck out to the party early 🙂

With this, Buzzword and PhotoShop Express we are reaching the point where AS3 is powerful enough to handle just about anything short of the latest XBOX game.