I thought I was done with the Flash-embedded-font in my previous blog entry, but there is more. I received an email requesting help with CSS and embedded fonts, and when I looked into it, found some quirks related to the CSS specified font-family and bold/italic text.
Gotchas
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.
Array.sortOn does not work with MovieClips
Submitted by joelmay on 2 October, 2006 - 1:57pm.This problem drove me crazy. I'd thought I'd get it in the google-verse so anyone else who runs into it can benefit from my pain.
Array.sortOn() does not seem to work when the array elements are objects derived from MovieClip. The following code demonstrates.
Simple class. "zz" property will be used to sort an array of these objects.
Simulate download: Static vars not re-initialized
Submitted by joelmay on 4 May, 2006 - 3:06am.The 'Simulate Download' feature in the Flash IDE is very useful. It can help debug race conditions that are a cause of intermittent problems. However, it can also lead you astray.
Problem: AS2 static variables are NOT reinitialized when you hit control-Enter the 2nd time to go into simulate-download mode.
If you'd like to try it, here's a simple test class:
Component Array Parameter Gotcha
Submitted by joelmay on 22 November, 2005 - 11:18am.So the other day, I was working on a component that has an inspectable set/get array property. I could not get it work. Although the default value for this array was not zero length and the parameter in the dialog box was not zero length, the set function was being called with a zero-length array at initialization.
This was an invalid situation and broke my app.
Here's a simplified version of the code:
Flash Below the Browser Fold Gotchas
Submitted by joelmay on 26 August, 2005 - 7:44am.If your browser-embedded flash movie is not scrolled into view when it initializes, you can run into some weird, browser-dependent problems.
Here's what I've found:
