Decreasing load times with RSLs

Recently, Adobe released version 3.5 of the Flex SDK. I updated a project I was currently working on from 3.3 to 3.5 and I had to reset up my runtime shared library (RSL) for the project. This got me thinking that many people don't know how to properly use RSLs. The world of flex development is better if we all use the the SDK RSLs so that is the topic of today's post

Read More

Embedding Fonts in Flex Builder Using the Flash IDE

[ad#Adobe Banner] Flex is great for building rich internet applications quickly. Building an application quickly is nice, but to give your application that truly professional touch you need to customize the look and feel of your app. In order to fully customize the look and the feel you will need to use a font that's different than the default serif font that is used everywhere.

The flash player affords you the opportunity to embed many non standard fonts into your app, something that sets it apart from AJAX applications that need to rely on web safe fonts. In the flash IDE this is as easy as setting the font in the properties panel and selecting which character from that font which you want to embed. In a Flex app, things get a little trickier - especially if you want to use a non True Type font, which is the only type it can import natively. However, if you have the Flash IDE you can use its simplicity to get any font you can use in Flash into your Flex app.

The process is broken up into two steps.

  1. Create a SWF with the font(s) you need embedded in it
  2. Add Style (CSS) info to your Flex project that imports the font into your Flex project

Character Embed Dialog in Flash

Step one starts with the simplest of FLA files and can be created with earlier versions of the Flash IDE  (so you can use Flash 8 or MX2004 if that's all you have). I recommend using a separate FLA for each font you want to embed, that way it is easier to catalog, store and reuse in other projects. Create 4 dynamic text fields. Each text field is for the different versions of the font so you should have:

  • normal
  • italic
  • bold
  • bold italic

You need to make sure you set up all 4 text fields to embed all the glyphs from the font you will need.  For most western languages Numerals, Punctuation and Basic Latin should cover all the glyphs you will need. Once again, make sure to set up the character embedding for all 4 text fields. If you notice certain parts of your flex document using the default font you may not have set up character embedding. You can of course leave out any of the 4 ( ie italic and italic bold ) that you aren't going to use but if you are going to reuse the SWF I would do all 4.

Once you are done setting the character embedding for all 4 text fields, publish the file to a SWF. [ad#Google Adsense] The second step of this process is to add Style to your Flex project that imports the font into the project. That's as simple as adding an @font-face entry to your CSS file or <mx:Style> block. At first you simply give it the path to your font SWF and the name of the font ( ie Futura Book, Calibri ).

@font-face
{
src:url( "path/to/yourFont.swf" );
fontFamily:"Exact Name of Font"
}

You also need to add an @font-face entry for each version of the font you want to use. So if you also wanted to use the bold version you would add the following:

@font-face
{
    src: url( "path/to/yourFont.swf");
    fontWeight:"bold";
    fontFamily:"Exact Name of Font";
}

After you are done adding the appropriate @font-face entries you can style any component you need to or you can style the entire application with your font.

Application
{
    fontFamily:"Exact Name of Font";
}

There are a couple other ways to embed fonts, and if you don't have a version of the flash IDE those are the only way to go. If there is enough interest I can cover those in comments or another post. However this is by far the simplest, it allows you the ability to embed non True Type fonts and you can reuse a font more quickly in the future. [ad#Adobe Banner] If you liked this post please subscribe to my RSS feed and/or follow me on Twitter. If you only want to see my Flash Friday posts you can follow the subscribe to the Flash Friday feed. How's that for alliteration :) Until next time keep on coding.

FSI Navigator Alpha 2 released

I have released the alpha 2 version of my FSI Navigator AIR Application. The only new feature is that it uses the AIR Update Framework to check for an update once a day. At this point the updates are automatic only, with no way to manually update. Manual update checks will be available before the 1.0 release.

It is recommended that all current users update to this version so that they can keep up with the latest news in the pre-release process.

Also, don't forget to report bugs and request features at my issue tracking site:
http://www.ducharme.cc/mantis/

Language Lessons 2 - My first decent AIR app

A while ago I wrote a blog post titled "Language Lessons." It was a post designed to showcase some of the 'cheap as free'™ ways to study a language. One of those ways was fsi-language-courses.com, a website dedicated to making the public domain FSI language courses freely available in an electronic format. While it is a great resource, the site isn't extremely usable. Adobe Integrated Runtime(AIR) to the rescue. ...

For all my talk of being a Flash/Flex expert ( Flexpert? ), I have yet to make a decent AIR app. Sure I've made a couple of tools to help me out with some minor tasks( get map lat/lon coordinates, creating a tool to help me learn degrafa ) but nothing very usable for anybody else ( or exciting to make ).

With all that in mind it is with great excitement that I announce my first alpha release of th AIR FSI Navigator. This tool allows you to navigate their different language programs and view the pdfs while you listen to the accompanying audio ( if they are available of course ). As with most alpha software, this has a long way to go before it is considered released ( and I will most likely release it as open source long before that ), but you might find it useful.


FSI_Navigator.air
This application requires Adobe AIR 1.1 be installed on your computer. If it is not you can download it from the Adobe website.UPDATE: It is easier to just use the install badge at the bottom of this post.

Known Issues ( not an exhaustive list )

  • Certain courses do not work. Especially if the course contents are located in a zip file.
  • PDFs take a while to load and there is no download notification. Be patient, if you have Adobe Acrobat 8.1 and the screen is black,it just means the PDF is loading ( some of them are quite large ).
  • Closing the MP3 Playback window shade and then reopening it decreases its height.
  • Downloads are not saved to your hard drive for offline work. This feature is planned for the future, in fact it will be the default so that files don't have to be downloaded from the server every time.
  • Volume thumb bar isn't visible when the program starts. Just click on the volume adjustment area and it will show up.

Update: I thought I'd do a quick attempt to add an install badge for this:

Yahoo Flex Map Component Part 3 available

Part 3 in my multi part series on building a flex component out of the Yahoo! Maps API is available over at the Flexcoders group.

In part 1 of this series I talked about the reasons why you would want to make a flex component out of something you can do in actionscript. In part 2 I discussed the basics of the component architecture. From that second article you can create a component that works however you still haven't handled most of the reasons to make a component in the first place. In this article I will take care of those issues the issues of data binding, event handling and making it easier for non coders( sometimes called designers or managers :) ) to work with.