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.

With over two decades of deep front-end expertise, I offer comprehensive web consultancy and stack audits, alongside specialized workshops, training, and engaging public speaking to elevate your team's skills and optimize your digital presence. Contact me.