     
                 _height *= scalingFactorY;
             }
-            else if (invalidateSizeFlag)
-            {
-                // If we're not compatible with Flex3 (measuredHeight is pre-scale always)
-                // and scaleX is changing we need to invalidate parent size and display list
-                // since we are not going to detect a change in measured sizes during measure.
-                invalidateParentSizeAndDisplayList();
-            }
             
-            super.scaleY = oldScaleY = _scaleY;
+			oldScaleY = sY;
         }
 
         if (x != oldX || y != oldY)

     */
    override public function set x(value:Number):void
    {
        if (super.x == value)
            return;

        super.x = value;

        invalidateProperties();

        dispatchEvent(new Event("xChanged"));
    }

    //----------------------------------
    //  y

            return super.mouseY;
        return globalToLocal(new Point(0, root[fakeMouseY])).y;
    }
	
	
	/**
	 * Documentation is not currently available
	 */
	protected function allocateOffsets():void
	{
		var at:TransformOffset = new TransformOffset();
		at.addEventListener(Event.CHANGE,transformOffsetsChangedHandler)
		at.userVisible = false;
		at.layoutScaleX = scaleX;
		at.layoutScaleY = scaleY;
		at.layoutScaleZ = scaleZ;
		at.layoutRotationX = rotationX;
		at.layoutRotationY = rotationY;
		at.layoutRotationZ = rotation;
		at.layoutX = x;
		at.layoutY = y;
		at.layoutZ = z;
		_xformOffsets = at;
		invalidateTransform();
	}
	

    
    private function setTransform(value:flash.geom.Transform):void
    {
        // Clean up the old event listeners
        var oldTransform:mx.geom.Transform = _transform as mx.geom.Transform;       
        if (oldTransform)
        {
            oldTransform.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, transformPropertyChangeHandler);
        }
        
        var newTransform:mx.geom.Transform = value as mx.geom.Transform;
        
        if (newTransform)
        {   
            newTransform.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, transformPropertyChangeHandler);
        }
    
        _transform = value; 
    } 

    private function assignTransformMatrices():void
    {
			var m:Matrix = _transform.matrix;
			var m3:Matrix3D =  _transform.matrix3D;
			if(m != null)
				matrix = m.clone();
			else if(m3 != null)
				matrix3D = m3.clone();
			
			invalidateSize();
    }
    
	/**
	 * Documentation is not currently available
	 */
    public function get $transform():flash.geom.Transform
    {
    	return super.transform;
    }
    
	/**
	 * Documentation is not currently available
	 */
    override public function get transform():flash.geom.Transform
    {
    	if(_transform == null)
    	{
    		setTransform(new mx.geom.Transform(this));
    	}
    	return _transform;
    }

    override public function set transform(value:flash.geom.Transform):void
    {
    	setTransform(value);	

        assignTransformMatrices();
        super.transform.colorTransform = value.colorTransform; 
    }

    

    private function transformPropertyChangeHandler(event:PropertyChangeEvent):void
    {
        if (event.kind == PropertyChangeEventKind.UPDATE)
        {           
            if (event.property == "matrix" || event.property == "matrix3D")
            {
            	assignTransformMatrices();
            }
            else if (event.property == "colorTransform")
            {
            	super.transform.colorTransform = _transform.colorTransform;
            }
        }
    }

	/**
	 * Documentation is not currently available
	 */
 	public function set offsets(value:TransformOffset):void
	{
		if(value == null && _xformOffsets != null)
		{
			value = new TransformOffset();
			value.userVisible = false;
			value.initFrom(_xformOffsets);
		}
		else if (value != null)
		{
			if(_xformOffsets != null)
				value.initFrom(_xformOffsets);
		}
		if(_xformOffsets != null)
			_xformOffsets.removeEventListener(Event.CHANGE,transformOffsetsChangedHandler);
		_xformOffsets = value;
		if(_xformOffsets != null)
			_xformOffsets.addEventListener(Event.CHANGE,transformOffsetsChangedHandler);
	}
	
	/**
	 * @private
	 */
	public function get offsets():TransformOffset
	{
		return (_xformOffsets != null && _xformOffsets.userVisible == true)? _xformOffsets:null;
	}
	
	/**
	 * Documentation is not currently available.  the matrix of a component is the transform matrix used to calculate its layout
	 * relative to its siblings. This matrix is modified by the values of the offset property to determine its final, computed matrix.
	 */
	public function get matrix():Matrix
	{
		if(_xformOffsets != null)
		{
			return _xformOffsets.layoutMatrix;			
		}
		else
		{
			return super.transform.matrix;
		}
	}

	/**
	 * @private
	 */
	public function set matrix(value:Matrix):void
	{
		if(_xformOffsets == null)
		{ 
			super.transform.matrix = value;
            invalidateSize();
		}
		else
		{
			_xformOffsets.matrix = value;
	   		invalidateTransform();
	   		invalidateParentSizeAndDisplayList();
  		}
	}

	/**
	 * Documentation is not currently available.  the matrix of a component is the transform matrix used to calculate its layout
	 * relative to its siblings. This matrix is modified by the values of the offset property to determine its final, computed matrix.
	 */
	public function set matrix3D(value:Matrix3D):void
	{
		if(_xformOffsets == null) allocateOffsets();
		_xformOffsets.matrix3D = value;
		invalidateTransform();
   		invalidateParentSizeAndDisplayList();
	}

	/**
	 * @private
	 */
	public function get matrix3D():Matrix3D
	{
		if(_xformOffsets == null) allocateOffsets();
		return _xformOffsets.layoutMatrix3D;			
	}

	
	/**
	 * Documentation is not currently available
	 */
	public function get layer():Number
	{
		return (_xformOffsets == null)? 0:_xformOffsets.layer;
	}

	[Bindable("layerChange")]
	/**
	 * @private
	 */
	public function set layer(value:Number):void
	{
		if(value == layer)
			return;
		if(_xformOffsets == null) allocateOffsets();
		_xformOffsets.layer = value;		
		dispatchEvent(new FlexEvent("layerChange"));
		if(parent != null && parent is UIComponent)
			(parent as UIComponent).invalidateLayering();
	}
	
	/**
	 * Documentation is not currently available. 
	 */
    public function invalidateLayering():void
    {
    	
    }
	
	/**
	 * Documentation is not currently available.
	 * Commits the computed transform stored in the xformOffsets object to the flash displayObject's transform. 
	 */
	protected function validateTransform():void
	{
		_xformOffsets.updatePending = false;
		if(_xformOffsets.computedIs3D)
		{
			super.transform.matrix3D = _xformOffsets.computedMatrix3D;				
		}
		else
		{
			super.transform.matrix = _xformOffsets.computedMatrix;
		}
	}

}

