A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Variables

  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    63

    Variables

    Hello!
    In my flashprogram i load variables from a local text file using this script loadVariables("txt/eng/modul5.txt", "");
    But when the program loads a text with a % the letter after dissapears.

    The line i load the variables from is like this:
    &t5_2_1a=Bla bla 25%.

    How shall I do to make the % appear?
    Thanks

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    url-encode the % character - %25

    try a LoadVars Object to load and display the variables -
    Code:
    lv = new LoadVars(); // create loadvars object
    
    lv.onLoad = function(){ // runs on load completion
    my_text.text = lv.t5_2_1a; // output to textfield instance name - my_text
    };
    
    lv.load("test.txt"); // load the variable from .txt file
    
    /*-- test.txt--
    &t5_2_1a=Bla bla 25%25&
    */

  3. #3
    Member
    Join Date
    Oct 2005
    Posts
    63
    Ah man, thank you very much!

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    you're welcome


    if you need more characters encoded, i have a url encode chart online -

    http://www.jackleaman.co.uk/flash/ur.../urlencode.htm

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