 		} 
 		while (!done);
 
-		return Math.max(0, Math.floor(spaceToDistribute - flexConsumed))
+		return Math.max(0, Math.floor((spaceToDistribute + unused) - flexConsumed))
 	}
 	
 	/**

			flexConsumed = 0; // space consumed by flexible compontents
			done = true; // we are optimistic
			
			// Space for flexible children is the total amount of space
			// available minus the amount of space consumed by non-flexible
			// components.Divide that space in proportion to the percent

		var numChildren:int = childInfoArray.length;
		var flexConsumed:Number; // space consumed by flexible compontents
		var done:Boolean;
        
		// Continue as long as there are some remaining flexible children.
		// The "done" flag isn't strictly necessary, except that it catches
		// cases where round-off error causes totalPercent to not exactly
