Flash MX Pro 2004 - Text Area Component - Using the TextArea
(Page 5 of 6 )
As you can see by the new TextArea Component Inspector (Fig. 4), the promise of this Component is that you can link text content from an online database, creating a reusable dynamic display. With the new Class structure in ActionScript 2, you can also create a reusable style set to govern the appearance of the TextArea's background color, skins, etc. However, my less lofty goal was to add a text file to one component and get it to display with some style. In my view, an upgrade to a program should make the harder things simple while not making the simple things hard. So far, I'm finding the simplest things being much harder to do - a situation that might be remedied by better documentation.

Fig. 4 – TextArea Component Inspector
Warning: One of the most important changes to the new ActionScript model is the addition of Class Structure, which is used as an integral part of creating styles and definitions, among other things. This new way of doing things is taken for granted by the programmers who wrote the manual, but it is not well or often explained to the new user. One thing that really threw me is a rather basic thing. I've used PHP but never used Classes. I never needed them, so when seeing new code like
myTextStyle
= new TextField.StyleSheet();
myTextContent = new XML();
it never dawned on me that this code was a Class definition. I thought it was a variable definition, and I couldn't figure out how anyone could keep reusing a variable definition 'new Anything' for multiple instances without losing the original variable. In this example, new XML() creates an instance of the predefined XML Class which exists in ActionScript 2. If you do not understand that you can create multiple instances of a Class, you will be lost with much of the documentation provided with Flash 2004. So, the following code is a valid way of creating three instances of text XML object:
myTextContentA
= new XML();
myTextContentB = new XML();
myTextContentC = new XML();
An instance of a Class is different animal entirely than a variable definition – as in myText.text = "a string", which defines the value of the text itself. So, with that warning, we shall proceed.
Next: Steps >>
More Flash Articles
More By Jefferis Peterson