Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7703099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:22:53+00:00 2026-05-31T23:22:53+00:00

I hope I am clear enough. My data set is populated I have comment:CommentVO;

  • 0

I hope I am clear enough.

My data set is populated I have

 comment:CommentVO;
 comment.replies=[comment:CommentVO,comment:CommentVO,comment:CommentVO];

_comments:Array = [comment:CommentVO,comment:CommentVO,comment:CommentVO]

I’ve correctly populated my _comments Array and the replies array in my CommentVO Obj.

This works

   for each (var comment : CommentVO in _comments) {
     trace("TOP COMMENT" + comment.raw_message);

         for each (var comment : CommentVO in comment.replies){ 
           trace("1st DEPTH COMMENT REPLY " + comment.raw_message);

            for each (var comment : CommentVO in comment.replies){  
            trace("2nd DEPTH COMMENT REPLY " + comment.raw_message );

               for each (var comment : CommentVO in comment.replies){   
                 trace("3rd DEPTH COMMENT REPLY " + comment.raw_message);
                }   
                }
          }
     }

But I knew that the comment replies depth was 3 levels down.
How can i make that loop check to see if comment.replies array has content and run the loop?
It might look something like this but this is not correct.

         var i:int=0;
          for each (var comment : CommentVO in _comments) {
              trace("TOP COMMENT" + comment.raw_message );

                      for each (var comment : CommentVO in comment.replies) {    
                     trace( i + "DEPTH COMMENT REPLY " + comment.raw_message );
                             if(comment.replies.length >1){
                             i++;
                        }
                      }

               }       

I hope I am clear enough….I’ve been banging my head with this.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:22:54+00:00Added an answer on May 31, 2026 at 11:22 pm

    Here is the answer for anyone who needs it!!! and trust me you will if your data tree is dynamically generated without you knowing how deep the child to parent relationship will be.

       for each (var comment : CommentVO in _comments) {
                  trace("TOP COMMENT" + comment.raw_message );
    
                         listReplies(comment.replies);
    
                         }
                   }    
    
    
      private function listReplies(replies:Array):void{
                 for each (var comment : CommentVO in replies) {          
    
                                trace(  " >>>>>> " + comment.raw_message);
    
                     if (replies.length > 0 ){ 
                                     listReplies( comment.replies); 
                                    }
    
                   }
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope I'm asking this correctly: I have a project Projects.Client I have my class
The docs at www.fastcgi.com aren't clear on this (to me), so I hope someone
I have a data set that I need to calculate the trait average of
I hope this makes sense. I have a ASP.NET web application that uses Entity
I hope the title and following text are clear, I'm not very familiar with
I hope I can make myself clear in English and in what I want
I hope I can explain my problem in a way that it's clear for
Hope anyone can shed light on this so I can use pens with dash
(Hope this doesn't get duplicated; second attempt at submitting this question) I'm working on
Hope this is the right place to be asking this, so my apologies if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.