开发者

flash spacing on line break in text field

I've got a dynamic html text field in flash which pulls content from an XML file, which is being generated by a CMS using CK Editor. I'm not sure if that has anything to do with it, but flash represents a <br/> tag with a space that seems more fitting for a <p> tag, and a <p> tag renders with about double that amount. How do I control this? I've tried specifying margins in the flash css file, bu开发者_开发知识库t it has no effect. Is there something I can declare in the actual actionscript code?


I assume that TextFormat.leading isn't the problem or the solution.

Out of curiosity, is the <br /> tag followed by an actual return in the xml?

Try using:

XML.ignoreWhitespace = true;

and/or

TextField.condenseWhite = true;

to your actual xml and textfield.


How about adjusting the leading property using a CSS Stylesheet or a TextFormat?

Or adjust the Property panel settings for the TextField if it's on Stage.

flash spacing on line break in text field


With XML files that have line breaks, Flash usually interprets those as TWO line breaks. One for the CR character (carriage return) and one for the LF characte (line feed): \r and \n, respectively. I always filter the CR's out by using this:

text = text.split('\r').join('');

This may be why you see those empty lines.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜