Wednesday, June 11, 2008
Wednesday, June 11, 2008  0 Comments   Links to this post   

We've all been acquainted with String.fromCharCode in relationship to event.keyCode, but it also works with Number. Why would you want to do that?

Well, I am getting sets of keyboard inputs as keyCodes from a piece of hardware, and I build up an angle to use. A delimiter lets me know when to stop per each set.

In order to translate the keyCodes back to numbers for use in building up the angle to use, instead of using a method to translate the keyCodes to a Number to use, you can simply do something like this:

var code:Number = event.keyCode;
var n:Number = Number.fromCharCode( code );

And from this I build up an array, looking for a delimiter all the time, and when I get the delimiter, build the angle number and use it. Of course this fails if you are getting keyCodes that are out of range of 0-9, so you need to filter your keyCodes as they come in.

I haven't seen any public code (yet) that uses Number.fromCharCode yet, and for me it works perfectly, so I thought I'd throw this out there.

Labels: ,

Wednesday, May 28, 2008
Wednesday, May 28, 2008  1 Comments   Links to this post   

I'm a sucker for various types of string manipulations when presented in visually rich Flash sites/applications. If done right, they can really dress up something that might otherwise be a little boring.

A paragraph of text for instance, presented on the "my media is rich" website (coming soon™) is pretty interesting. Roll over the About Us or Contact Us links on the menu bar to see what I mean.

This is just as interesting as the standard typewriter effect or random text unscramble (train station display character flipping). Since I haven't seen this used yet before, it's a little fresh still. 

So I decided I'd like to code up a class that mimics this same treatment. You can see the effect below.


There are a few ways to accomplish the task. Mine runs a little slower by choice, but that's super easy to control. I am actually offsetting the effect line to line too, so the last line finishes a hair later than the rest.

This is a class that I could clean up and release, but I am guessing it's not all that hard to code up for yourself. It's really just about timers, some formatting and string manipulation.

Labels: ,




Evangeline Lilly from Lost set to various states of pixel processing & mouse manipulation in 3D space. Just another older experiment that I had occupying drive space that I thought might be of interest to some.

Labels: ,

Friday, May 23, 2008
Friday, May 23, 2008  5 Comments   Links to this post   



A BitmapData pixillation effect (well, it is working by using the same principle as stop motion video to produce the effect).

Labels: ,

Friday, July 6, 2007
Friday, July 6, 2007  0 Comments   Links to this post   

Okay, so here are rumors galore about the Flash Player coming to an iPhone sometime in the future. There are three things that I can see wrong with the player on the iPhone (and with some genius they could all be sorted).

  1. Battery life. Someone needs to make a player that isn't Flashlite, but consumes a lot less CPU to do its rendering - taking advantage of the hardware more. I am sure the iPhone does this on its own already with all the speedy transitions. Give that to the Flash Player, and that would be a big help.
  2. Edge sucks, so we'd have to worry a little about the size of most Flash content, how it gets cached and eats memory, and how it would perform on a slow connection (something most of us have simply forgotten about). A caching mechanism or something could possibly help.
  3. The iPhone gesturing might get confused with Flash content underneath it that also sucks up mouse events? Probably not, but maybe. Depending on how the Flash was developed, it could make things weird, especially for full-screen Flash apps and websites. This is probably the easiest thing to fix.

Labels: ,