Adding text to dynamic text field

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Adding text to dynamic text field

    When loading text from an external text file into a dynamic text field using the following Action Script:

    Features_lv = new LoadVars();
    Features_lv.onLoad = onText;
    Features_lv.load("about_us.txt");
    function onText() {
    aboutus_txt.text = Features_lv;
    }

    The text does load successfully into the field but all spaces are displayed as '%20', does anyone have an idea why this is happening?

    Thanks
    Schalk


    Volume4 webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. XML to dynamic text field
      New to XML. This is probably basic. Trying to load titles of lessons from an XML file to individual dynamic text fields without using a component....
    2. load external text to dynamic text field in levels
      Dear Sir I found the Tech Noe Index #16238 is useful in creating dynamically loaded text from external text file. However, the method mentioned...
    3. How to center text in dynamic HTML text field ???
      In Flash MX 2004 I suddenly find myself comletely helpless trying to align all text to the center in my dynamic text field. I dont recall running...
    4. Can you Mask a dynamic text field?
      I have tried this, but the text doesn't show at all. Is it a limitation? Thanks Geoff
    5. Dynamic text in smooth scrolling text field - help
      here's links to the files. http://www.anicespot.com/test/ http://www.anicespot.com/test/easing_textScroller-01.html...
  3. #2

    Default Re: Adding text to dynamic text field

    Interesting issue!

    I don't understand the reason you declare the function to do all this but I figure you have your reasons. In doing that you are pulling the text without the "quotes" that read back as spaces instead of %20.

    Mabey declare variables within the text like:
    line1=this and that&line2=this and that.

    I may be off track here, I would like to see this problem solved. I hope this helps...

    Good Luck!


    eonyron webforumsuser@macromedia.com Guest

  4. #3

    Default Re: Adding text to dynamic text field

    Thanks for your input, I resolved the issue. It was really just an issue of me not completely understanding the process of reading information into Flash that has been loaded using loadVars().

    I have changed the code now to the following:
    var content_lv = new LoadVars();
    content_lv.onLoad = setContent;
    content_lv.load("about_us.txt");

    and set the content as follows:
    function setContent() {
    aboutus_txt.text = content_lv.aboutus;
    // The only real change being calling content_lv.aboutus instead of just content_lv
    // .aboutus being the name from which you want to extract the value in the external text file's
    // name=value pairs.
    }

    Hope this can help someone else out and save them some time.
    Schalk


    Volume4 webforumsuser@macromedia.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139