AS3: OSMF LightweightElement

You are in need of a simple video player, iightweight and easy to use?
You think OSMF is too complicated, let me correct you and present you the LightVideoElement Class.

Simple to use, quickly up and running and all needed “basic” features available.
It’s even a default in OSMF, I actually wonder why no one has written about it yet, it’s really easy to use and you can do all the basic things with it that a videoplayer needs to support nowadays and on top of it, it’s only 10k when compiled.

I’ve been using it for the last 2 projects I’ve made, and I couldn’t be happier, let’s have a quick look on how to use it: » Read more…

AS3: Embed specific characters (part.2)

Just as a quick update, I’ve updated the previously created unicode finder app, to be a bit more helpful for the everyday usage.
Here a list of things that have been changed:

  • No double unicodes.
  • Automatic generation of embed code, easy for you to copy & paste directly into your application.

One thing that I can’t handle for you is to define the source of the font with it’s according fontname as defined in your system, but hey if I find a way around this, I will update it.

And again if you would like to play around with it, here the app. Have fun!

AS3: Embed specific characters

You might have read on one of my previous tweets, where I was screaming about using “special” characters in Flash, with “special” I mean arabic, cyrillic, hebrew, chinese simplified and traditional, as well japanese.

I know,  I know, there is TLF (Text Layout Framework) that handles the whole text, but I’m talking about embedding the font, did you knew that the complete chinese Unicode range helds something around 20’000 characters? You might think so what? Let me tell you that the complete chinese character range is over 7MB big!!! Do you really want to let your viewers download a 7MB file just for the font? No.

So I’ve created a quick app that will enable you to read out the UTF code from the text you need to use, with it you can specifically embed only the characters you need and take the file size down to a minimum. Now there is only a downside of this method, if the textual content changes a day, you need to again import the new characters.
Apart from that, I haven’t seen any bad things about this implementation.

At the end of this post you will find an useful small tool to get all the needed characters. » Read more…

Foundation Flash CS5

After 4 years Tom Green and I just published our latest book, this time we are not talking about Flash & After Effects, rather the newest and coolest version since the history of Flash, Adobe’s Flash CS5. If you are just learning the ins and outs of flash, then this is a book you shouldn’t miss, lots of examples, code snippets, cool projects and even an Android game is being built.

Flash is one of the most engaging, innovative, and versatile technologies available—allowing the creation of anything from animated banners and simple cartoons, to Rich Internet Applications, interactive videos, and dynamic user interfaces for web sites, kiosks, devices, or DVDs. The possibilities are endless, and now it just got better.

Flash CS5 boasts a host of new features, including the much-anticipated iPhone application creation feature, a whole new animation engine enabling full manipulation of tweens and paths, custom easing, improved inverse kinematics, a revamped timeline, built-in 3D, and much more.

» Read more…

AS3: Multiline textfields and Line Metrics

Last week I had to do something that I never thought of, let me present you the case:

First of all we have a multiline, word-wrapped textfield in AS3, the text is picked up from an external XML file and gets styled with a CSS stylesheet, the textfield CAN have one line or multiple lines (depending on the translation and the language used), if the text is only an one-liner, the graphic (a simple small gray arrow) needs to be placed after the text in the middle of the first line, so you are able to visualize this, think about a standard <li> tag where you get the black dot, in my case just at the other side eg. at the end fo the line. have a look at the Example for a visual clarification what I want to achieve.

Basically a simple task, you grab the textlength add the gutter and margin to it and place the small arrow at that position.. but what do you do when the text goes multine and word wraps automatically?
After doing some experiments, I’ve came up with a simple yet appropriate solution for this.
» Read more…