I guess the topic of dynamically loading fonts in Flash swfs is fairly old by now, and has been covered by several other people. But this was always something I meant to write up so … better late than never? I should say that while the way I did it back in the day works, Flex offers a few short cuts over a Flash IDE only approach. Anyway this is my take on the subject and is what I used when I was building the Flash albums for Zoto.
Category Archives: ActionScript
Flash, Cookies, and Sockets
One of the things I’ve always thought was missing from Flash was access to a browser’s cookies. I can understand the argument that cookie access is unnecessary for sites that are primarily flash based. After all Flash’s Local Shared Objects make persisting data across sessions or page views fairly painless. However for hybrid sites where the server passes information to the browser via cookies a developer must jump through a few hoops to get any important data sent from the server via a cookie into Flash.
An ActionScript Proxy Event Dispatcher
There are times when I need to listen to an object’s event for just a single dispatch and then be done with the listener. When I’m faced with this situation I tend to want to define the event handler as a closure or an anonymous function as opposed to adding yet another class method to handle the dispatch. A complication with this approach comes from the fact that I also want to explicitly remove my event listeners for the sake of good garbage collection. So, to have my cake and eat it to I created a proxy class that takes care of listening to the event and cleaning up after itself once the event has been handled.