How did this get by a code walk at MM? Did they outsource their component creation, cuase I’ve always been told MM was against prototyping built-in objects?
All, of these methods are obviously used on Movieclips inside the components, so I can’t figure out why they didn’t just extend the movieclips being used, instead of dirtying up every movieclip in a users movie.
class mx.core.ext.UIObjectExtensions
// add stuff to MovieClip
var mc:Object = MovieClip.prototype;
mc.getTopLevel = ui.getTopLevel;
mc.createLabel = ui.createLabel;
mc.createObject = ui.createObject;
mc.createClassObject = ui.createClassObject;
mc.createEmptyObject = ui.createEmptyObject;
mc.destroyObject = ui.destroyObject;
// add CSS style processing
mc.__getTextFormat = ui.__getTextFormat;
mc._getTextFormat = ui._getTextFormat;
mc.getStyleName = ui.getStyleName;
mc.getStyle = ui.getStyle;
class mx.managers.DepthManager
// Only one depth manager is needed. When created it adds the methods to the
// base classes
function DepthManager()
{
MovieClip.prototype.createClassChildAtDepth = createClassChildAtDepth;
MovieClip.prototype.createChildAtDepth = createChildAtDepth;
MovieClip.prototype.setDepthTo = setDepthTo;
MovieClip.prototype.setDepthAbove = setDepthAbove;
MovieClip.prototype.setDepthBelow = setDepthBelow;
MovieClip.prototype.findNextAvailableDepth = findNextAvailableDepth;
MovieClip.prototype.shuffleDepths = shuffleDepths;
MovieClip.prototype.getDepthByFlag = getDepthByFlag;
MovieClip.prototype.buildDepthTable = buildDepthTable;
// applyDepthSpaceProtection();
}