Flash Needs 3D to Compete with WPF
It’s a sad statement to have to make, but it’s true. Since I’ve started learning WPF for work, I’ve been pretty impressed with the features, especially the 3D support. A non-programmer can easily create and manipulate 3D objects as well as project live data or even video onto those surfaces. The actual 3D geometry isn’t anti-aliased so it is pretty jagged, but using 2.5 D like we have in After Effects, is flawless. This is something that Flash is going to have to support because I envision every company wanting their product represented as a 3D object that can be manipulated in all directions. But at the very least, we need to have After Effects 2.5 D control.
Below is one of the test examples I made over at theWPFBlog.com. It consists of a 3D rectangle that has video playing on one side, and has a bio, photo, and timecode readout on the other. The timecode is dynamically being updated on the 3D surface. There is also a 3D progress bar, which is also a 3D rectangle, which adjusts itself based on the video playhead. You can also click and drag to rotate the panel in 3D space. You can right-click and drag to scale it up or down.
Click on the photo below to check it out. You will need IE 7 and the WinFX runtimes installed to view it.
You can do it Adobe!
Lee
Automatic Text Color Selection in Flash 8
Below is some code that I wrote that will automatically select the best text color based on it’s background. I know the word “best” is subjective, so I really should say it will have the best contrast. This accomplished using color matrices and Quasimondo’s great ColorMatrix class. It basically sets the text color to same as the background, then inverts the color, and finally, desaturates the color. The problem is that it starts to get muddy when you get to a middle tone. To fix this I added a contrast property that when set to 100, always produces either black or white. You can lower this property to see the whole range of grays. In the example below you can click on the color picker to set a new background color. As you move around you should see the text changing. The class code is below as well.
[as]import com.quasimondo.geom.*;
import flash.filters.*;
import flash.geom.*;
class AutoTextColor {
private var backClip:MovieClip;
private var textClip:MovieClip;
private var cm:ColorMatrix;
private var trans:Transform;
private var ct:ColorTransform;
private var contrast:Number;
function AutoTextColor(bc:MovieClip, tc:MovieClip) {
ct = new ColorTransform();
trans = new Transform(bc);
contrast = 100;
backClip = bc;
backClip.cacheAsBitmap = true;
textClip = tc;
textClip.cacheAsBitmap = true;
}
public function setContrastLevel(con:Number):Void {
contrast = con;
}
public function setBackColor(col:Number):Void {
ct.rgb = col;
trans.colorTransform = ct;
cm = new ColorMatrix();
cm.colorize(ct.rgb,1);
cm.invert();
cm.desaturate();
cm.adjustContrast(contrast,contrast,contrast);
textClip.filters = [new ColorMatrixFilter(cm.matrix)];
}
}[/as]
Lee
theWPFblog.com is now launched!
I’ve just launched a new blog that focuses on WPF development and will focus mainly on how it compares to Flash. I will need to start learning WPF and the Expression tool for work so I figure I might as well document my travels. From what I’ve seen and used so far, I’d have to say that I’m pretty impressed with it. Having true 3D support is something that Flash will have to face if they want to keep ahead of the competition. So come on over to http://www.theWPFblog.com and check it out!
Lee
My CD on eMule
Wow I guess finally arrived because my Flash video disc is being traded on file sharing networks like eMule. Of course I’d rather that they pay for it. But it’s nice to see that people actually want to watch it.

Lee









