Does anyone know if there is a way to customise the line height of text in a TextArea component that uses css to control the xml content? Most other styles seem to work fine in the stylesheet, but not that one...
Printable View
Does anyone know if there is a way to customise the line height of text in a TextArea component that uses css to control the xml content? Most other styles seem to work fine in the stylesheet, but not that one...
Below is a list of the CSS styles that Flash supports. In BOLD are the CSS properties, in ITALICS are the ActionScript Equiv. and plain text is the description: This is all right from the MX04 AS Dictionary:
- text-align >> textAlign >> Recognized values are left, center, and right.
- font-size >> fontSize >> Only the numeric part of the value is used; units (px, pt) are not parsed; pixels and points are equivalent.
- text-decoration >> textDecoration >> Recognized values are none and underline.
- margin-left >> marginLeft >> Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent.
- margin-right >> marginRight >> Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent.
- font-weight >> fontWeight >> Recognized values are normal and bold.
- font-style >> fontStyle >> Recognized values are normal and italic.
- text-indent >> textIndent >> Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent.
- font-family >> fontFamily >> A comma-separated list of fonts to use, in descending order of desirability. Any font family name can be used. If you specify a generic font name, it will be converted to an appropriate device font. The following font conversions are available: mono is converted to _typewriter, sans-serif is converted to _sans, and serif is converted to _serif.
- color >> color >> Only hexadecimal color values are supported. Named colors (like blue) are not supported.
- display >> display >> Supported values are inline, block, and none.
Hey.. just came across this:the link to the whole blog post is http://www.whatdoiknow.org/archives/001181.shtmlQuote:
Specifying the leading / line-height through a CSS is indeed not possible but if you set it (using actionscript) in the _styles part of the of the Textfield.StyleSheet object it will work. So anyone any experience in overruling the default CSSParser?
Posted by: Eric at June 2, 2004 04:54 AM
It's even easier, agd these lines of code to your styleSheet.onLoad section and the leading/line-height will work!Posted by: eric at June 2, 2004 08:16 AMCode:for (stijl in this._css) {
if (this._css[stijl].lineHeight != undefined) {
this._styles[stijl].leading =
Number(this._css[stijl].lineHeight.slice(0, this._css[stijl].lineHeight.indexOf("p")));
}
}
maybe that will help?...
Thanks alot for your help - i appreciate it. to be honest it sounds a bit beyond me, but i know this problem is going to wear me donw eventually so i might just give it a crack :-)
sorry to be a pain, but where would i find the 'stylesheet.onload section' or even the textfiled.stylesheet object?