author: Krasimir Tsonev

Hi there, I'm . Senior front-end engineer with over 13 years of experience. I write, speak and occasionally code stuff. Follow me on Twitter, GitHub, Facebook or LinkedIn

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. Or maybe comment below: