Well what are you trying to add ?
Just a shape, a circle to be precise.
But i've had problems with many display objects, so i thought it was a generic problem
It's not that it doesn't work in Flex 4+. It doesn't work in classes that implement IVisualElementContainer. You can only add IVisualElements to an IVisualElementContainer. This is similar to how you could only add IUIComponents to Containers in Flex 3.x.
UIComponent is an IVisualObject, so if you want to do things the way you'd have done them in Flex 3 to add a Shape, you can wrap it in a UIComponent. However, Flex 4 offers some pretty cool enhancements, if you use the spark primitives (for instance Rect or Ellipse). If it can put them all in one DisplayObjectContainer, it will, which helps with CPU usage. Check out http://help.adobe.com/en_US/flex/using/WSda78ed3a750d6b8fee1b36612357de97a3-8000.html for more details.
I tested code the other day for adding a rectangle to my app using the following code and this worked.
private function createRectangle():Sprite
var s:Sprite = new Sprite();
s.graphics.lineStyle(2, 0xcccccc, 1, true);
protected function init(event:FlexEvent):void
rec = new InlineGraphicElement();
rec.source = createRectangle();
...the rest of the init functionwith my addChild I gave it an id to cling onto 'diagramA' which was attached to '<s:p id="diagramA">' further within my main code etc,Hope this helps