views:

1446

answers:

3

Background: I'm building this photo gallery in AS3, when user clicks a thumbnail is displays text gathered from an XML file.

Problem Description: Everything runs wonderful on my local machine, but when I upload the files to the server and preview the site from the server, the line spacing on the description text is way different than when I preview the site local.

Below see two images so you can see the difference

Correct one (Preview from Local Machine)

Incorrect One (From the Browser)

Solution: Any suggestions?

A: 

Your images don't show up (I think there's a minimum reputation required to post images), but based on the description I'm going to guess that your local machine is windows and the server is unix. It's probably a problem with line-endings being \r\n instead of \n, most editors can do this conversion for you, or there are various tools to convert.

If this isn't right, link to the images so that we can see what's happening.

Chad Birch
Actually I'm using Mac and posting into a windows server. Are you referring to place the \r\n into the xml file?the link of images is: http://www.olemedia.net/lineSpacing1.jpghttp://www.olemedia.net/lineSpacing2.jpg
Ole Media
I would like to add the comment that this is ActionScript3 and I'm getting the info from an XML file that looks like this:<DESCRIPTION>Content Line oneContent line twoSo on...</DESCRIPTION>
Ole Media
Ok, so it's the opposite of what I had guessed, but the problem is that you're getting too much spacing on the server, right? Image #1 is the result that you want?
Chad Birch
corrent. I'm curious to know if there is a solution
Ole Media
A: 

I found the solution. Is a bug with Flash CS4 (mac and windows).

I place my flash file to a Linux server and also to a windows server. Definitely windows server was the problem. I'm not sure why but it is. I'm working from mac, and possibly this effect also on the type of server you publish you swf files.

Thanks everybody, much appreciate your time and dedication.

Ole Media
+2  A: 

It is indeed a line break issue that depends on what platform you're on, or rather. how the xml document was saved. Line breaks on windows are \r\n (Carriage Return + Line Feed). if I recall correctly. Flash player interprets both as a newline. I usually do something like this:

var text:String = xml.whatever.text().split("\r").join("");

That will get rid of all the \r's (if they're there) and leave only \n's.