Whenever you want to out put the array you wipe the htmlText before you run
the output loop:

mainText.htmlText = "";
for(var i:uint = 0; i < cueArray.length; ++i) {
        mainText.htmlText += "<b>" + cueArray[i] + "</b>";
}


This might be a bit inefficient, setting the .htmlText repeatedly would, I
suspect, fire a lot of HTML class events.  So it might be better to have a
separate String variable that you set first and then fire at the HTML
instance:

// init the string
var html2render:String;

// displaying the cueArray
html2render = "";
for(var i:uint = 0; i < cueArray.length; ++i) {
        html2render += "<b>" + cueArray[i] + "</b>";
}
mainText.htmlText = html2render;


--------------------------------
Andrew Murphy
Interactive Media Specialist
[EMAIL PROTECTED]

Delvinia
214 King Street West, Suite 214 
Toronto Canada M5H 3S6

P 416.364.1455 ext. 232  F 416.364.9830  W www.delvinia.com

CONFIDENTIALITY NOTICE
This email message may contain privileged or confidential information. If
you are not the intended recipient or received this communication by error,
please notify the sender and delete the message without copying or
disclosing it.

AVIS DE CONFIDENTIALITÉ
Ce message peut contenir de l'information légalement privilégiée ou
confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir reçu par
erreur ce message, nous vous saurions gré d'en aviser l'émetteur et d'en
détruire le contenu sans le communiquer a d'autres ou le reproduire.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Jinks
Sent: Tuesday, July 08, 2008 7:33 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Basic loop problem (with end of message)

Thanks to everyone for your help. This gets me closer to what I'm looking
for.

Unfortunately, there's a complicating factor: if the user scrubs across the
same point in the video again, they end up with duplicates/triplicates of
the list.

Since we actually want people to do this, I'm looking for a solution that
will replace the existing text with the full array on each cuePoint event.
I thought that my original code would do this - unless there's a better way
of achieving this?

Hope this makes sense and thanks again.

Paul


On Tue, July 8, 2008 12:09 pm, Piers Cowburn wrote:
> Hi Paul,
>
> Try:
>
>   var len2 = cueArray.length;
> for (var i = 0; i<len2; i++)
> {
>       mainText.htmlText += "<b>"+cueArray[i]+"</b><br>"; }
>
> Piers
>
>
>
> On 8 Jul 2008, at 11:56, Paul Jinks wrote:
>
>> Apologies for last post: it got sent before I'd finished. That'll 
>> teach me to try to use the tab key using IMAP ;-). Here's the message 
>> again in
>> full:
>>
>> 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>";
>>         }
>> But what this does is print only the last item in the array, whereas 
>> I'm expecting it to print the array in full.
>>
>> TIA
>>
>> Paul
>>
>>
>> _______________________________________________
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> [EMAIL PROTECTED]
> 0207 631 3278
>
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Check out my website: http://www.pauljinks.co.uk :o)


_______________________________________________
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