A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: MX2004-Text Area component HTML tag freaking dynamically created string out.

  1. #1
    Senior Member pup100's Avatar
    Join Date
    Oct 2004
    Location
    Close
    Posts
    575

    MX2004-Text Area component HTML tag freaking dynamically created string out.

    Hi,

    I am using a text area component in MX2004 to print out a line of text one letter at a time.

    I had the whole thing working great, but wanted to put some HTML formatting into it, so added the line of code to enable HTML in the field into which I was typing. Now when I I test the movie each letter appears on a separate line so you will get something like:

    S
    h
    e

    s
    e
    l
    l
    s

    Can anyone offer me any help on this.

    Code set out below.

    Fla attached.


    code:
    holdEm_str = "She sells sea shells on the sea shore";
    _root.past_txt.html = true;
    counter = holdEm_str.length;
    down = 0;
    function addLetter() {
    if (down<counter) {
    _root.past_txt.text += holdEm_str.slice(down, down+1);
    down++;
    past.focusTextField.scroll = past_txt.focusTextField.bottomScroll;
    } else {
    clearInterval(letterTime);
    }
    }
    var letterTime = setInterval(addLetter, 45);

    Attached Files Attached Files
    Last edited by pup100; 03-26-2009 at 05:34 AM.
    You will know everything when you know you never will.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    holdEm_str = "She sells sea shells on the sea shore";
    _root.past_txt.html = true;
    counter = holdEm_str.length;
    down = 0;
    function addLetter() {
    	if (down < counter) {
    		_root.past_txt.text = holdEm_str.slice(0, down + 1);
    		down++;
    		_root.past_txt.focusTextField.scroll = _root.past_txt.focusTextField.bottomScroll;
    	} else {
    		clearInterval(letterTime);
    	}
    }
    var letterTime = setInterval(addLetter, 45);

  3. #3
    Senior Member pup100's Avatar
    Join Date
    Oct 2004
    Location
    Close
    Posts
    575
    Again I fall at you feet dawsonk!

    I'm not too sure what is happening there, but would imagine that rather than adding each individual letter you are now adding the entire string + the new letter.

    Hopefully that should be it for the dynamic text part of the project I am working on so I shouldn't have to pull on your apron strings again this week, but again thank you for you help with the two problems I have had.
    You will know everything when you know you never will.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center