2 Replies Latest reply on Sep 6, 2012 4:16 AM by Harbs.

    TypeError: Error #1034: Type Coercion failed when Layer.parent

    jordidy Level 1

      Hi,

       

      In Photoshop, when I use Layer.parent the object returned is always a HostObject.

      Is there anyway I can check if a Layer's parent is type LayerSet or Document?

       

      For example:

       

      var l:* = layer.parent;

      if (l is LayerSet) { // do something; }

      if (l is ArtLayer) { // do something different}