Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

images stretched vertically loading external/html text - dyn txt box

Status
Not open for further replies.

JGALEY

IS-IT--Management
May 21, 2003
105
US
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:

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
 
I am having a similar issue, and having another issue with fonts not appearing correctly for the client, but appearing fine for me here. It seems that if I embed the fonts, I am having the stretching issue occur. If I do not embed the fonts, it does not occur, but the fonts are not the same between systems.

Did you get an answer?
 
No, no answers yet that I have been able to find. I had to move on to other things and leave this one for the moment.

I will try to remove the reference to the font tag (I am assuming this is what you mean by embedding the font) from my HTML and see if that does the trick.

I could live without the red color I specified in the font tag, but I would like to be able to use it if possible.

Thanks,

Jason
 
Jason, no luck yet with me either. I added font tags to my txt file (I have 5 separate ones that it is loading on separate incidents) but no luck yet. I hear you about the colour thing. I even tried to add in a reference to my css and it did not work. There has to be a solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top