2 Replies Latest reply on May 18, 2006 1:25 PM by kanag

    Starter

    kanag Level 1
      I am starting with Flash I need to create a component that can read data from a XML file. The entries are in the form:
      <thumbnail>
      <image> http://...</image>
      <text>The description here</text>
      <url>url of page to open when clicked</url>
      </thumbnail>

      It should parse the file and display as many entries there will be on the same line (up to 5) or some default text if an error has occurred.

      Could someone point me to some tutorial on how to do this?

      Thanks
      Thomas C.
        • 1. Re: Starter
          tonyhigham Level 1
          http://www.actionscript.org/tutorials/intermediate/XML/index.shtml
          this tutorial is a great place to start as far as importing and parsing the xml...if you need help getting the info into arrays and or using it once it's been parsed, let us know
          • 2. Re: Starter
            kanag Level 1
            Thank you for the link that's some good tutorial.

            I am able to parse the content of the file and I create text areas to display the data. Each area is created with the script and then filled with html that is compatible with Flash.

            Here is a sample of the code:
            stext = "<img src='"+simage+"' width='40' height='30' hspace='30'/><font size='3'>"+stext+"</font>";
            initialization={editable:false,html:true,text:stext,wordWrap:true};
            myTextArea = _root.attachMovie("TextArea","myTextArea"+a,a,initialization);
            myTextArea._x = xofs;
            myTextArea._y = 0;
            myTextArea._width = xdelta;
            myTextArea._height = Stage.height;
            trace('myTextArea._height: '+myTextArea._height);

            And it displays n areas with each their own text. The prolems I have are:

            1) The scrollbars are pretty ugly they must be 50 pixels wide with big arrows

            2) There is 2 borders for each component: one outside that is dark gray and one inside that is light gray. I would prefer to remove them.

            3) Event when setting the height to Stage.height, the components don't fit the vertical space. They go at about half of the dimension.

            4) The image width and height have to be reduced to display at the correct scale. For eg: 96 / 72 pixels goes to 40 x 30.

            So If you could help me with any of these problems you are welcome.