A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: external text different language

  1. #1
    Ronin
    Join Date
    Dec 2001
    Location
    Mexico
    Posts
    34
    I'm using Flash MX version and when the movie loads the
    external text all the characters with accent disapear (the text is in spanish) somebody knows how to solve this big
    problem ?

    Thanks

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    162
    Wow, I just found the answer to this and I've been searching forever... The process is a little strange but it works perfectly.

    Ensure your text file is formatted like this, quotations and spaces included:


    //!-- UTF8
    myVar = "Ã*áâãäåçèéêëìÃ*îïðñòóôõö" ;

    IMPORTANT
    You must save the file in the UTF-8 format. You can do this with notepad and selecting Save-as and then choosing the encoding type as UTF-8. This is key to this working so don't forget!

    Now the next important step is loading the variables into the SWF. Instead of using loadVariables(), you have to use the #include command. So, on the first frame of your movie clip that contains the dynamic text field, attach the following code:

    Code:
    #include "path/to/your/text/file"
    N.B.: The semi-colon was intentionally omitted.
    That should do it!

    I'm so happy! I've been trying this for so long... : )

    -ptolemy

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Simply add the following on the first frame of your movie, when publishing for Flash 6, and type your text file as usual:

    System.UseCodePage=true;

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    162
    Boy, that's bit of an easier method, eh? Heheh, saves me some work Thanks!

    -ptolemy

  5. #5
    Ronin
    Join Date
    Dec 2001
    Location
    Mexico
    Posts
    34
    [QUOTE]Originally posted by ronin56
    [B]Thanks ptolemy !!!! ;-)

  6. #6
    Ronin
    Join Date
    Dec 2001
    Location
    Mexico
    Posts
    34
    Originally posted by ronin56
    it works !! Fantastic !! Thank you very much guys

  7. #7
    Senior Member
    Join Date
    Mar 2002
    Posts
    160
    hello guys,
    i found a hope here i can solve my problem too, which is very similar.,
    i need to use a xml file in my flash file, the xml file is coming from an access database, which is written in arabic, the problem is i get the arabic scentence reversed in the flash file,(i.e. "he is" does appear "is he " plz HELP

  8. #8
    Junior Member
    Join Date
    Sep 2000
    Posts
    25
    THNX pateym !!
    Your post saved me from a big problem I always had!

    My external file was a .as file that was loaded in a popUpWindow (using the popUpWindow component found in flashcomponents.com) and with your help now
    I can make movies that contain greek characters.

    Really really Thnx!

    bye
    chris

  9. #9
    Senior Member
    Join Date
    Mar 2002
    Posts
    160

    what about my problem with XML please HELP

    by the way what is the : popUpWindow component
    can i make a pop up window ?? in flash , i have tried before but i failed

  10. #10
    Senior Member
    Join Date
    Apr 2001
    Posts
    162
    birail23, I'm glad I could help

    [EDIT]
    Sorry but I realized that this is not exactly what you need. In fact it will completely reverse your text. I guess you could create an array that contained each word and then simply output the array contents in reverse orrder... I'll see what I can do.

    rasha ali, I'm not familiar with using XML or Access but the following function will reverse a string using ActionScript. As the code suggests, your text should be contained within a MC and have the variable name myText. I've tried this out using a simple dynamic text field with a pre-defined string and it works like a charm. I'm sure you can adapt this for your needs.

    Code:
    onClipEvent(load) {
    	letterCount = myText.length;
    	holder = myText;
    	myText = "";
    	
    	for(i=letterCount; i >= 0; i--) {
    		myText +=  holder.charAt(i);
            }
    }
    Cheers,
    ptolemy
    )

    BTW, I don't know anything about the pop-up window component...

  11. #11
    Senior Member
    Join Date
    Apr 2001
    Posts
    162
    Ok, this one works by reversing the order of each individual word in a string:

    Code:
    onClipEvent(load) {
      words = myText.split(" ", myText.length);
      words.reverse();
      myText = "";
    
      for(j=0; j<=words.length; j++) {
        myText += words[j];
        myText += " ";
      }
    }
    Cheers,
    ptolemy

  12. #12
    Junior Member
    Join Date
    Sep 2000
    Posts
    25
    Sorry the link was wrong!

    It's http://www.flashcomponents.net
    and the specific popUpWindow component is at
    http://www.flashcomponents.net/compo...fm?nav=2&id=43

    bye

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