Within an TextArea you could do that using htmlText, how do you usually make a search in the flex builder help?
and define a style named 'normalFontStyleName' which include a normal font style, and you probably want to define another italic font style name to change it back as well
How do I usually search in Flex? I click on the help button and enter a search term. For example, I did a search on "On change," Properties panel, 'change=""' In every case, a whole lot of unrelated or distantly related stuff comes up.
I'd really like to know what that field is for if not for what I thought it was for.
In Flex Builder if you have a line of code like this for instance
<mx:DataGrid id="myDG" />
If you select the word DataGrid or at least have the text cursor somewhere around this word, pressing Shift+F2 will take you to the language reference about that class and there you'll probably find what you want, the methods, properties, styles and so on. The thing is that you aren't finding anything useful is because in Flex there isn't anything like on Change, however there's a event change that a lot of components dispatch. Also in the flex help search, next to the search input, there's a link that says search scope there you can refine where the help system looks for info too.
"The thing is that you aren't finding anything useful is because in Flex there isn't anything like on Change, however there's a event change that a lot of components dispatch."
Thank you Michael. The Shift+F2 will probably come in handy. You said above that there isn't anything like "on Change." This is might be true (I'm sure it is if you say so) with respect to coding, but there certainly is a field in the properties panel called "On change:" and I'm still wondering what that is. I'm also wondering how to find an explanation of the interface (this part, and other parts) through help. I have attached an image of the Properties panel so show that I'm not imagining this field.
From an interface design perspective, people like me are perfect testors. You might say I should intuitively get the answer, but if I don't, the interface is at fault. Programmers don't buy this line of reason, and that is why interface design sucks. Because programers design interface, but don't test them.
Properties.png 46.2 K
Yes I forgot about that part, it's true and there are other properties on click too, so there are a bit misleading you're right, if you're developing a Flex app, most likely you'll have to go to the code view so I don' think that'll be a problem. I can't see your image, sometimes it takes a long time for the forum to upload image, you could upload it somewhere else and post the link.
I saw your image, as I told you before you were right if you want look about what the change event does in the textinput I recommend you to just type in the search box: TextInput and then choose the language reference that says mx.controls.TextInput and then look at the events and there you'll find the change event and what it triggers.
Listening for a change event is not really ok because if I'm not mistaking, a change event is triggered even if the user types someting into the TextInput( and you don't want events to trigger on every character you type into the field; except, if that's the purpose of your application ). A much cleaner approach would be to listen for focusIn and focusOut events and combine these with a custom TextFormat object.
You would be doing something like this:
- Create a TextFormat object that will handle the text formatting from "normal" to "italic".
- Add a focusIn and focusOut listener to your TextInput.
- When the user focuses the input field then inside the focusIn handler, simply apply the correct TextFormat to your TextInput( in this case, you'd be applying a format that will display the text the user enters as "italic" ).
- When the TextInput looses focus then inside the focusOut handler you'd apply the TextFormat object again, but this time, without italic, causing your text to display as "normal text" once more.
Simple and more efficient than trying to do the same thing with a change event.