Results 1 to 6 of 6

Thread: How to display special characters in XML driven photo / caption gallery

  1. #1
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default How to display special characters in XML driven photo / caption gallery

    Hello!
    I have a question about XML in flash.
    I have a photo gallery that utilizes XML to call out the photo as well as the caption.
    See XML data below:

    <image thumb="thumb/FACILITY_TMB_BATH-02.jpg" big="big/FACILITY_LG_BATH-02.jpg" title="Ogni cottage dotato di un bagno elegante" />


    This is the AS that calls for the photos and captions (The whole script is very long, so I am only going to annote the part that calls for the XML): It goes like this:

    xml.load("xml/io/io_resort_gallery01.xml");
    for (var i = 0; i<numOfItems; i++) {
    var t = this.attachMovie("item", "item"+i, i+1);
    }

    My problem is that the data wont display special characters like or or
    I am worried because I am using multiple languages, and as it is I am having to remove important characters from translations...

    I also have a second AS that calls for XML data for body copy which which works great, displays all characters in multiple languages, and allows HTML code to be used:

    XML Data:
    <texts>
    <text><![CDATA[<b><font size="14">Il lusso fa parte dell'alloggio...</font></b>
    Con 15 lussuosi cottage, siamo in grado....]]></text>

    ActionScript:
    stop();
    my_xml = new XML();
    my_xml.load("xml/io/io_resort_text_galleries.xml");
    my_xml.onLoad = my_function;
    my_xml.ignoreWhite = 1;

    function my_function() {
    acc_mc.accomodations.html = true;
    acc_mc.accomodations.htmlText = my_xml.firstChild.childNodes[0].firstChild.nodeValue;
    }

    Any idea on how to get the XML for the photo gallery to display all characters?
    This is also going to have to accomodate russian and Japanese so I am bit nervous...
    Thanks for your help in Advance!
    From Santa Cruz, CA
    Zeech26
    Last edited by zeech26; 07-09-2009 at 08:52 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    smack me if you tried this already but:

    Can you set the formatting of the text box where the xml will go to use an embedded font?

  3. #3
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default How to display special characters in XML driven photo / caption gallery

    Evan, I had not tried that, and it seemed like a great idea until it didn't work!
    Thanks for your response. I think it has to do with the coding of the XML, but i'm still stumped...
    Help!
    thanks
    zeech

  4. #4
    Join Date
    Aug 2007
    Location
    Harrisburg, PA
    Posts
    131
    Thanks
    6
    Thanked 9 Times in 9 Posts

    Default

    Have you tried urlencoding your special characters? I know using text files you need to do this to see special characters it's most likely the same with xml. here's a link to a chart that has all the codes.

    http://i-technica.com/whitestuff/urlencodechart.html

    If your not familiar with urlencoding just put the code the chart says in place of the letter.

  5. #5
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default How to display special characters in XML driven photo / caption gallery

    "Have you tried urlencoding your special characters? I know using text files you need to do this to see special characters it's most likely the same with xml. here's a link to a chart that has all the codes."

    I tired that, it displayed the character as written in the URL code unfortunately.
    I am thinking that I have to incorporate CDATA in the XML file, but I am not sure how to do that. with this type of gallery.

    Thanks for your help, that is great for future reference.
    Anybody else have any ideas?
    Thanks again,
    zeech

  6. #6
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Figured it out

    Evan, I figured it out.
    I added this to the actionscript:
    system.useCodepage = true;

    And then, like you suggested, I went back and embedded the characters (latin)
    cheers!
    zeech

Bookmarks

Posting Permissions

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