views:

150

answers:

1

Hi,

One of the functionalities in my current flex application requires me to maintain a comments section. Here, the users can post the comments and the replies to existing comments. All I want is like the usual thread style commenting.

Let say, I am replying to someone else's comment, so, it will align my comment by a tab or so and people can easily see the comments and replies.

e.g.

USER ABC : COMMENT 1

-----USER XYZ: RE:COMMENT1

----------USER DEF: RE:RE:COMMENT1

and so on...

Can anyone suggest a way to do this?

Thanks :)

+1  A: 

In your database you would store the parentID for each comment. You can query that data and loop through it creating new objects to display the comments however you want.

Store the results in an ArrayCollection

var tmpCanvas:Canvas;
for(var i:int = 0; i < ac.length; i++)
{
    // display data
    tmpCanvas = new Canvas();
    tmpCanvas.x = ...
    tmpCanvas.y = ...
    // add items to the canvas      
    this.addChild(tmpCanvas);
}
Chris Klepeis
Ohh awesome! 'll try that. Thanks :)
online19