sure you added your '_nodeContainer' Sprite to the display list?




On 5 May 2008, at 16:34, Weyert de Boer wrote:

Hello!

I am currently a bit clueless regarding using Flex components. I am
currently trying to port a .NET component to Flex. Only I have some
problems. In a simplified form the problem is that I am trying to add
childs to the component. The idea is to use public method to add nodes
to the component. The code could be:

var node: MyNode = new MyNode();
node.width = node.height = 125;
myComponentInstance.addNode( node );

The addNode-method is basically contains:

public function addNode( node: MyNode ): void {
_nodeContainer.addChild( DisplayObject(node) );
invalidateDisplayList();
}

The _nodeContainer is a Sprite class which gets created in the overriden createChildren-method. Now I would be expected that the MyNode- instance
(which just draws a simple rectangle 125x125) would be shown. Sadly
enough, this is not the case.

Does anyone know what should be done to get this working?

Yours,
Weyert de Boer



Reply via email to