okay - this is quite a quick one to solve

the problem you're having is that you're overwriting the htmlText each
iteration so you're only outputting the last iteration of the loop

what you need to do is add the output of the loop iteration (that is every
time the loop fires) to the htmlText as it's created

so instead of:
mainText.htmlText = "<b>"+cueArray[i]+"</b>";

you need
mainText.htmlText = mainText.htmlText + "<b>"+cueArray[i]+"</b>";

or more simply
mainText.htmlText += "<b>"+cueArray[i]+"</b>";

This will put everything into a long line - if you want each loop iteration
to appear on a separate line you should add <p> tags or a <br /> tag so:
mainText.htmlText += "<p><b>"+cueArray[i]+"</b></p>";

hope this helps
a

On Tue, Jul 8, 2008 at 11:50 AM, Paul Jinks <[EMAIL PROTECTED]> wrote:

> Hi
>
> I'm new to coding and I'm having a problem getting a for loop to do what I
> want it to. I think this is pretty basic, but I'll let you be the judge.
>
> I have a project to play through an flv which fires event cue points at
> certain points. At these points, text appears at the side of the video
> window as summaries of what's being said. The summary text is the name of
> the cue point and is added to an array called cueArray after checking that
> it doesn't already exist. So far so good.
>
> The last step is to output the full array to the text field and it's at
> this point that I'm at hitting head against wall pitch. I just can't get
> it to output the whole array in sequence. What I'm using is:
>       var len2 = cueArray.length;
>        for (var i = 0; i<len2; i++)
> {
>                                mainText.htmlText =
> "<b>"+cueArray[i]+"</b>";
>        }
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to