Text area line height customisation with css
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Text area line height customisation with css

  1. #1
    Junior Member
    Join Date
    Nov 2000
    Posts
    11

    Text area line height customisation with css

    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...

  2. #2
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    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.
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  3. #3
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    Hey.. just came across this:
    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!
    Code:
    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")));
    }
    }
    Posted by: eric at June 2, 2004 08:16 AM
    the link to the whole blog post is http://www.whatdoiknow.org/archives/001181.shtml

    maybe that will help?...
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  4. #4
    Junior Member
    Join Date
    Nov 2000
    Posts
    11
    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 :-)

  5. #5
    Junior Member
    Join Date
    Nov 2000
    Posts
    11
    sorry to be a pain, but where would i find the 'stylesheet.onload section' or even the textfiled.stylesheet object?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com