This content has been marked as final. Show 4 replies
Pretty sure u can use a .as file as an 'include' sheet....
> Is it possible to attach a stylesheet to an input text field and have that text
> pick up the style? I have dynamically created my own text fields, and have
> succesfully attached a stylesheet and written htmltext to use the style, that's
> not a problem. But when the text field is an input text field, I can't just
> specify a "<span class='xxx'></span>" or something to use as the default class
> for the text field, right? The goal is to have the text that the user types in
> styled by the stylesheet. I tried naming the CSS class "body" (I was
> hopeful..) but alas, my hopes were dashed like a lemming on a rock.
> Anyway, any help would be .. helpful. Thanks.
Sure it's possible
Thanks for the reply.
I understand how to apply CSS formatting to static or dynamic text, but what about input text?
I've been having similar problems with Input fields and styleSheets. I found this in a book, which goes against other documentation but seems to hit the spot of acknowledging a problem (no solution, however...)
In the big red book, Macromedia Flash MX 2004 ActionScript 2.0 Dictionary by Macromedia Press, Chapter 8: Working with Text, Page 346:
When you assign a style sheet object to a TextField object, the following changes occur to the textfield's normal behavior:
• The textfields 'text' and 'htmlText' properties behave identically and always contain the same value
• The textfield becomes read-only and cannot be edited by the user
• The setTextFormat() and replaceSel() methods no longer function.
• Any text assigned to the textfield (either via .text or .htmlText property) is stored verbatim, and can be retrieved in the text's original form
This is a total kick in the head and contradicts the typical documentation statement that you can apply styleSheets to dynamic and input textfields.
I don't know the answers, but that seems to confirm our findings...