 		{
 			if (child is UIObject)
 			{
+				var element : UIObject = UIObject(child);
 				m_contentDisplay.addChildAt(child, index);
-				UIObject(child).setParent(this);
+				element.setParent(this);
+				
+				
+				if (index == 0)
+				{
+					element.m_isFirstChild = true;
+					if (m_children.length)
+					{
+						UIObject(m_children[0]).m_isFirstChild = false;
+					}
+				}
+				//if the child is reparented, the value needs to be reset
+				else
+				{
+					element.m_isFirstChild = false;
+				}
+				if (index == m_children.length)
+				{
+					element.m_isLastChild = true;
+					if (m_children.length)
+					{
+						UIObject(m_children[m_children.length-1]).m_isLastChild = false;
+					}
+				}
+				//if the child is reparented, the value needs to be reset
+				else
+				{
+					element.m_isLastChild = false;
+				}
+				
 				m_children.splice(index, 0, child);
 				invalidate();
 			}

////////////////////////////////////////////////////////////////////////////////

package reprise.ui { 
	import reprise.events.DisplayEvent;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;

			{
				return;
			}
			var len : int = m_children.length;
			var i : int;
			var keyOrder : Array = [];
			
			for (i = 0; i < len; i++)
