connectedpixel.com

actionscript, web development

Graphics

The Unbearable Strangeness of Embedding Fonts

Submitted by joelmay on 21 December, 2006 - 8:28am.

The 'why' and 'how' of embedding fonts is a Flash 101 topic. The main 'why' is that the user can't see fonts that she doesn't have. If your swf uses these fonts, you need to bundle them in the swf (or with the swf). The 'how' also seems very simple: in the properties panel for a given text field, click the 'Embed' button and select the character range you want to embed. Click OK. Done. Move on.

But it's really not that simple. Once you start using fonts in a shared library, referring to embedded fonts in a css file, etc. weird problems start popping up. I've had embedded text working in some swfs but not others, static fields displaying garbage and bloated swfs.

Face Morph - Part 1, Morphin' George

Submitted by joelmay on 6 June, 2006 - 4:24pm.

Unlike Grant Skinner's gooify, which is a free-form distortion, the morph presented here is more constrained. It has an editable triangle mesh (which I'm not showing right now).

Flash Perlin Texture Components: Wood and Marble

Submitted by joelmay on 20 April, 2006 - 12:26pm.

A while back, I wrote about rendering Wood and Marble using Perlin noise. But I've found that these code bits are a pain to use. You need to write code just to see them. You can't work with them in the Flash IDE; i.e. they are inconvenient.

Solution: package them in components with live preview. That way you can see them, adjust their color visually, mask them, drop shadow them, etc.

Flash8 Perlin Marble Texture

Submitted by joelmay on 8 November, 2005 - 2:25pm.

Last week, I wrote an article about using Flash 8 Perlin noise to generate a wood texture. Today, it's marble.

According to this link, the Perlin formula for marble is:

texture = cosine( x + perlin(x,y,z) )

Again, we don't want to do math on every pixel -- too slow. So, how do we do this with the existing Flash 8 API? First, let's pretend that the perlin term in the above equation is not there. Here's what our image would look like (this image is arbitrarily blue monochrome):

Flash8 Perlin Wood Texture

Submitted by joelmay on 1 November, 2005 - 12:36pm.

The Flash 8 documentation for perlinNoise() has this intriguing statement:

You can use Perlin noise functions to simulate natural phenomena and landscapes, such as wood grain, clouds, and mountain ranges.

OK. That sounds like fun. But how is this done? It's not immediately obvious, at least not to me. So I googled .

According to these links (here and here), the formula for wood is:

g = perlin(x,y) * 20;
grain = g - int(g);

"Ultimate Aqua Button" in Flash8

Submitted by joelmay on 11 October, 2005 - 1:09pm.

Since OSX first appeared, I've been in love with the aqua button look. I still love it.

CommunityMX has a great tutorial by Brian Edgin on creating an aqua button with Fireworks. It looks like a real piece of glass. I've seen a few Flash-only aqua buttons. They're very cool, but they're not as nice as the Fireworks version. Flash 7 was not capable of that degree of realism.

But now we have blends and filters in Flash 8. We can make an all-vector aqua button with the same quality as the Fireworks version.

XML feed