May 29 2012

Actionscript Vector Short Hand Notation

I can never remember the short hand notation for Vectors in actionscript 3, so I write it down here once and for all. Hopefully it might even help someone else.

You can declare and instanciate a new Vector by typing one of the following:

// Long way
var vec1:Vector.<int> = new Vector.<int>();

// A little bit better
var vec2:Vector.<int> = Vector.<int>([1, 2, 3]);

// Yeah, I like this one B-)
var vec3:Vector.<int> = new <int>[1,2,3];
Oct 04 2010

Error reading xml attribute when migrating from Flex 3 to 4.1

I have been struggling with several migration issues when going from flexSDK 3.2 to 4.1. This is another strange one…

Jul 31 2010

Embedded fonts disappear when updating to Flex SDK 4.1

I recently updated my flex SDK to 4.1, (from 3.x) just to find that all my embedded fonts were missing.

This was the scenario:

  • Embedding fonts using the [Embed] meta tag
  • Applying font using TextFormat (don’t know what happens if you use CSS, my guess is that it won’t work either)

Quick fix: note the “embedAsCFF”

[Embed(source="font.ttf", fontFamily="x", mimeType="application/x-font", embedAsCFF="false")]
public var FontClass:Class;