If you are trying to deeply clone a display object, this is the only way for me:
public static function clone(target:DisplayObject ):DisplayObject { var bitmapClone:Bitmap = null; var bitmapData:BitmapData = new BitmapData(target.width,target.height,true,0x00000000); bitmapData.draw(target); bitmapClone = new Bitmap(bitmapData); bitmapClone.smoothing = true; return bitmapClone; }
Please note that this will only visually copy the object. It will not copy methods or properties. I used this when I uploaded external images and used them in several places.
Mihai raulea
source share