PDA

View Full Version : Dynamic Text Multiline Display



superiority
November 13th, 2006, 10:42 AM
Hey guys.

I am trying to make a dynamic text box in flash 8 that will display text that I create using a function. Like this.


function Messages(words:String) {
if (i<5) {
i++;
words = (_global.words) + i;
words = "";
}
talker.text = (_global.words1 + _global.words2 + _global.words3 + _global.words4 + words)
IDInterval = setInterval(resetTalker ,10000);
}Maybe you can see what I'm trying to do from this?

In any case. I am trying to make a formula so that when you enter something like:


Messages("Hello World");
Messages("How are you?");the text

Hello World
How are you?

will appear, on seperate lines.

Can anybody see what and how to do what I'm trying to do?

Thanks =).

P.S. sorry if somebody has posted this, but i did search so ... =S

SlowRoasted
November 13th, 2006, 10:50 AM
I think it should be something more like this



function Messages(words:String) {
if (i<5) {
i++;
words += (_global.words) + i + "/n";
}
talker.text = (_global.words1 + _global.words2 + _global.words3 + _global.words4 + words)
IDInterval = setInterval(resetTalker ,10000);
}

superiority
November 13th, 2006, 10:55 AM
Thanks SlowRoasted, but what does the 'n' symbolise. Is it the total number of _global.word's or ... i dunno, what is it?

bombsledder
November 13th, 2006, 11:11 AM
the "/n" symbolises a newline in flash you could write "/n" or you can write it as

words += (_global.words) + i + newline

SlowRoasted
November 13th, 2006, 11:11 AM
It puts in a line break.

I actually have it backward. It should be \n