How to create and load fontSwf files and use the loaded swf’s embedded font at runtime.

I just made a video tutorial that shows you how to:

  1. Create a swf with an embedded font.
  2. Create an application and loads that swf and pulls the embedded font from the loaded swf.

This is really simple and really smart if you need to have multiple fonts in your application.

FYI: once again for best video quality use the fullscreen button.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Pownce
  • StumbleUpon
  • Technorati

5 Responses to “How to create and load fontSwf files and use the loaded swf’s embedded font at runtime.”


  1. 1 jimbo

    I believe your flash detection is faulty – I have flashplayer 10 and cannot see your video – only the alternate content. Maybe your detection script thinks we have flashplayer 1 – kinda sucks.

  2. 2 Josh Chernoff

    Ow man I’m sorry, go figure that would happen if I left the default from cs4!

    I will use the swfObject asap.

    sorry guys.

    ::EDIT:: Fixed! you know what they say when you assume? you make an “ass’ of “u” and “me”
    And that what I get for assuming that CS4 knew how to embed the very software that it developed.

  3. 3 kevin

    Hey, first off: Great video! Thanks :)

    I am trying to use similar techniques to load in classes (as components) rather than load in a bunch of classes that I don’t need. I need to do this for a project at work… basically allowing our customers to create their own custom flash apps and load in certain functionality (through a user interface on our website).

    While my issue isn’t specific to loading in fonts, it does involve similarities as I am loading swf’s for their classes. The issue I am running into is that it works when I load in a swf that has a random key generation class and have the compiler set to NON-strict mode. But when in strict mode it says: 1180: Call to a possibly undefined method generateKey. generateKey is obviously a method in my loaded class (RandomKey.generateKey(_int:int))

    Would you happen to have a video or a link to tutorial that talks about loading in a class and using it much the same way as this one, but not using a font?

    thanks :)
    kevin

  4. 4 kevin

    Well, for anyone who cares my issue (stated above) stemmed from the fact that I was loading a Singleton class. From what I understand, now, the only thing you can do with a Singleton class is load it into a function as follows:

    var loadedClass:Class = e.target.applicationDomain.getDefinition(’com.site.RandomKey’) as Class;
    var generateKey:Function = loadedClass.generateKey;
    generateKey(_vars…);

    I hope this helps someone else who might be struggling with embedded assets.

    Again, thanks for the video, it was very helpful. :)

  5. 5 Josh Chernoff

    Very cool, I’m glad you figured it out. I was kinda stumped and was gonna look into it when I had free time. Sorry that I never got back to you.

    But looks like you got it all under control. Glad the video helped.

    - Josh Chernoff.

Leave a Reply