Flash MX Pro 2004 - Text Area Component - The TextArea Component – First Encounter
(Page 3 of 6 )
The advantage of the TextArea Component, which comes as an extension with Flash 2004, is that it has an embedded scroll bar. However, the manual does not teach you how to load a text file into the component itself. The instructions are to add text either directly into the component inspector by typing out the text longhand into the parameter field (Fig. 3) (that would only be practicable for short snippets of text), or to set the variable on the stage with
myText.text = "some text typed here." Neither of these solutions offers the advantage of having a separate text file that can be edited and updated without having to open Flash.

(Fig 3. – The TextArea Component Parameters Panel)
By creating an instance of the TextArea Component on the stage and naming it myText, I was able to load some text using an OnClipEvent action. But as you can see from the code below, I still had to type out my text directly onto the MovieClip on the stage. While I could create bold or italic text using simple HTML tags, I could not change the color of the text itself, using the specified color parameter in the manual. In fact, the only way I could find to change the text color was by using CSS and XML style sheets.
onClipEvent
(load) {
this.color= 0x003470;
// this code does not work to change text color!
this.text = "<b>Ideas arise first in the mind and then are set to paper, wood, and stone. </b> The task of the craftsman is to create works of art and draw out the beauty of an idea. <b>Peterson Design Studio</b> offers creative works for your business …";
}
Next: Bugs >>
More Flash Articles
More By Jefferis Peterson