Skip to content

Flash, CSS and Embedded Fonts

Seems like every time I get a new project that involves styling dynamically generated text in Flash, using custom fonts and with no access to Flex’s @embed trickery, I run into problems. I’m writing this blog entry not just to share a solution with you but also to have a single writeup for my own reference moving forward.

So, here’s the assignment: you’re working with Flash (let’s say CS4) and you have some dynamic textfields that are going to hold text. This text needs to be styled, dynamically at runtime. Font size is going to vary between 10 and 20. You know that some text is going to be set in one font (let’s say Avenir Heavy Oblique) and some will be set in another (let’s say Myriad Semibold Condensed Italic). The client even wants you to manually tweak the letter spacing on certain words. Setting properties on the textfields themselves, then, won’t work. You need to be able to handle custom styling of substrings within the larger set of content. How do you do it?

Continue reading ›

Tagged , , , , ,

Get Line Numbers on Runtime Errors in Flash!

So, this is something that’s really simple and I really wish I’d known about this years ago – would have saved me much time. Ever find yourself working on a project, and it’s 3am, and you’re exhausted but just want to kill this one bug, but WTF it’s a runtime error of some sort and you have no idea what’s causing it, only that something somewhere is null when it’s not supposed to be? You know, "TypeError: Error #1009: Cannot access a property or method of a null object reference..." with a stack trace?
Continue reading ›

Here goes nothing!

Every once in a while I install WordPress and promise myself that I’m going to start blogging regularly. Doesn’t really happen, but worth a shot. Expect this site to have various tech-related ephemera, probably centered around Flash. See you on the flip side!