Programming

PHP to generate font code for Flex

I have been loading Fonts for a project for over 2 hours now and I am about 70{9eb845e9932a4c0558a0305a78bf1c2d5042d8a06323e6cdeacdb9c8597fbf65} done. Basically I needed an SWF library of fonts to be used in an application I am developing, problem is the font needs to be registered (loaded) in order for the “New Font” option to see it. Now on the Mac I found adding/deleting fonts is easy, but very time consuming.

This is all being done in AS2, of course my love of Flash comes in to AS3, where I was able to (just for testing) create this little PHP script that reads a directory of fonts and creates the embed tags for me.. figured I would share it, so here it is.

Again, this is ONLY for AS3 (in Flex).

<?php
$dir = opendir('./fonts/');
while (false !== ($file = readdir($dir)))
{
if ($file != "." && $file != "..")
{
print "@font-face {\n\tsrc:url(\"fonts/" . $file . "\");\n\tfontFamily: myFont;\n\tflashType: true;\n}\n";
}
}
closedir($dir);
?>

It repeatedly prints out import blocks, like this:
@font-face {
src:url("fonts/LT_13171.ttf");
fontFamily: myFont;
flashType: true;
}

Flash printing, not playing nice

While working on a Flash project this week I came across a nice bug in the printing process. Basically you create a couple of shapes on the stage, call the print process and you get a printed page.. well thats how it is suppose to...

Custom iPhone, sort of

After really not liking the default layout on the home screen and missing custom ringtones I decided to hack my iPhone.. well sort of, more like forcefully modified my iPhone. Here is an older shot of the update.. now the carrier logo is "mkeefeDESIGN" because this...

AIR Compiler for Flash CS3

Adobe has indeed talked about compiler support for CS3 however it isn't available at the moment. Well Grant (gskinner) Skinner has developed an AIRCompiler for CS3. It is (as he mentions) a little difficult to get running, but once you do you can compile and...

Essential ActionScript 3 — just in

Essential ActionScript 3 is now out in your local stores should be soon, but this copy just arrived to my door from O'REILLY. I had the chance to edit and beta test this book and it was a great experience. The book is...

Flash contact form

After getting about 50 (not kidding) emails and comments I have decided the contact form needs an update. At the same time I wanted to let everyone know that the contact form in the How To WOW with Flash book is feature complete and ready...