• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • Last Modified:

XML question

Hi,
I am loading XML into the flash textfield....I want to add some images in the XML....I try to put <img src='museumPic.jpg'/> in the body text of XML file. I also put image museumPic.jpg in the same location where the swf file is. The image does not show up. Scripting is at below, how can I fix it. thanks



<?xml version="1.0" encoding="iso-8859-1"?>
<body>Isaac Newton (1642-1727)
<img src='museumPic.jpg'/>
Newton was an English physicisist and mathematician who discovered the binomial theorem, invented calculus, and produced theories of mechanics, optics, and the law of universal gravitation. Many of his ideas for ................ was knighted Sir Isaac Newton. </body>
0
Brian Lin
Asked:
Brian Lin
  • 3
  • 2
1 Solution
 
Brian LinDesignerAuthor Commented:
this is the script i put in the flash for load the xml

// Set up XML text
my_xml = new XML();
my_xml.onLoad = function( success ) {
      if ( success ) {
            scroll_txt.htmlText = this;
      }
};

my_xml.load( "page_1.xml" );
0
 
negatyveCommented:
With this code:

// Set up XML text
my_xml = new XML();
my_xml.onLoad = function(success)
{
      if (success) {
            scroll_txt.html = true;
            scroll_txt.multiline = true;
            scroll_txt.wordWrap = true;
            scroll_txt.htmlText = this;
      }
};
my_xml.load("page_1.xml");

if you are using flash mx 2004 and the image is a non progressive jpg, it works for sure.
0
 
Brian LinDesignerAuthor Commented:
can I also ask, how to set up the size for the image <img src='museumPic.jpg'/> ? like this <img width="12" src='museumPic.jpg'/> ?
0
 
negatyveCommented:
yep, exactly, but use both width and height..
0
 
Brian LinDesignerAuthor Commented:
ok...if I want to put text below image. I try to use <br>....not working....are there anything else ?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now