package skins { import flash.display.DisplayObject; import mx.controls.Alert; import mx.skins.ProgrammaticSpriteSkin; public class AvtSkin extends ProgrammaticSpriteSkin { [Embed(source='user.swf')] private var objClass: Class; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); while (numChildren) { removeChildAt(0); } if (getStyle('customIcon')) { addChild(getStyle('customIcon')); } else { var displayObj:DisplayObject = new objClass; var k: Number = 0.7;//displayObj.height/unscaledHeight; displayObj.height = unscaledHeight; displayObj.width = unscaledHeight*k; // displayObj.x = (unscaledWidth - displayObj.width)/2; addChild(displayObj); } } } }