Check out "Do you speak JavaScript?" - my latest video course on advanced JavaScript.
Language APIs, Popular Concepts, Design Patterns, Advanced Techniques In the Browser

Adding outline of text or MovieClip in Flash with AS3

As you probably know there is no such kind of option. We should deal with a little AS3 code.

The solution is to add glow filter to the DisplayObject (i.e. TextField or MovieClip). I wrapped the code in one simple function:

public static
    function addOutline(obj: * , color: uint, thickness: int = 2): void {
      var outline: GlowFilter = new GlowFilter();
      outline.blurX = outline.blurY = thickness;
      outline.color = color;
      outline.quality = BitmapFilterQuality.HIGH;
      outline.strength = 100;
      var filterArray: Array = new Array();
      filterArray.push(outline);
      obj.filters = filterArray;
    }
If you enjoy this post, share it on Twitter, Facebook or LinkedIn.