Flex 4 leaves a lot of components out such as DataGrid, DateChooser, all the Charting components etc. Those are some rather complex components to re-write. Presumably they’ll be included in an update to Spark someday. But <mx:Spacer /> was left out? How much more simple could a component be?
Turns out that it wasn’t left out by accident because it’s not needed anymore. I was customizing the <s:VideoPlayer /> this weekend and found that they use <s:Rect width=”?” height=”?” /> in place of the <mx:Spacer />.
Example: To create a 20 pixel horizontal space use <s:Rect width=”20″ height=”1″ />. That’s it. No fill or stroke needed, or wanted. That will just create an invisible space.
It doesn’t seem like they went out of their way to publicize that. The code hinting usually mentions something like, “use such-and-such instead” when you start to use an mx component that has a Spark equivalent.




One reason to use over <mx:Spacer> is that Rect is a GraphicElement, which means it shares DisplayObjects and should be lighter-weight than Spacer, which is a UIComponent and a DisplayObject.
Thanks for the elucidation. As a general rule I try to use mx as little as possible.
You know what would be ULTR-cool? A chart that shows not just the Flex class inheritance but also the file weight that comes with it. Ummmmm, if only I had the time and had a clue how to measure the weight.
Nice share thx
The Spacer control helps you lay out children within a parent container. Although the Spacer control does not draw anything, it does allocate space for itself within its parent container. look here more
http://satotravel1.info/