I have the following script code used to load text from a txt file into a dynamic text box, a different text file depending on the button the user clicked:
Here is an example of one of the text files getting loaded:
As you can see, the txt file is using HTML formatting, and there is an image being loaded with the IMG tag, with a height and width of 100 px.
The problem is that the picture is getting stretched a little vertically, even though the pic is 100 x 100, and even though I have specified height and width 100.
How can I correct this?
Thanks in advance for any help you can offer!
Jason
Code:
var Status_str:String= status_txt.text;
var TextFile_str:String;
switch (Status_str) {
case "MidAtlantic" :
TextFile_str = "flash/regionsMidAtlantic.txt"; break;
case "SouthernCal" :
TextFile_str = "flash/regionsSouthernCal.txt";
break;
case "Colorado" :
TextFile_str = "flash/regionsColorado.txt";
break;
case "South" :
TextFile_str = "flash/regionsSouth.txt";
break;
case "Central" :
TextFile_str = "flash/regionsCentral.txt";
break;
case "San Diego" :
TextFile_str = "flash/regionsSanDiego.txt";
break;
case "Las Vegas" :
TextFile_str = "flash/regionsLasVegas.txt";
break;
}
// Load text as variable and assign it to dynamic text field
region_lv = new LoadVars();
region_lv.onLoad = onText;
region_lv.load(TextFile_str); // the variable contains the name of the text file to load
function onText() {
regionInfo_txt.htmlText = region_lv.content;
}
stop();
Here is an example of one of the text files getting loaded:
Code:
content=<p><img src="flash/shaw.jpg" height="100" width="100"><b><font color="#d80029">Mid-Atlantic Region</font></b></p><br>
<p><b><font color="#d80029">Locations</font></b></p>
<li>Baltimore, MD</li>
<li>Savage, MD</li>
<li>Forestville, MD</li>
<li>Charles County, MD</li>
<li>Lorton, VA</li>
<li>Herndon, VA</li>
<li>Loudoun County, VA</li>
<li>Georgetown, DC</li>
<li>Raliegh, NC</li>
<li>Durham, NC</li>
<li>Columbia, SC</li>
<li>Charleston, SC</li>
As you can see, the txt file is using HTML formatting, and there is an image being loaded with the IMG tag, with a height and width of 100 px.
The problem is that the picture is getting stretched a little vertically, even though the pic is 100 x 100, and even though I have specified height and width 100.
How can I correct this?
Thanks in advance for any help you can offer!
Jason