Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
Like this article? We recommend

The Onscreen Text

Now you are getting somewhere. Here you use ActionScript to first create an empty movieclip named mc1 that is a child of this (this refers to the main movieclip, which is the _root, or the base clip of the entire application).

This will help ensure a clear and unambiguous path to the onscreen TextArea. Once mc1 is created, you can use dot syntax to create a TextArea object named text1, move it, size it, apply a stylesheet to it, and most importantly write the value of the variable textValue to it.

// Define onScreen TextArea
this.createEmptyMovieClip("mc1", this.getNextHighestDepth() );

mc1.createClassObject(TextArea, "text1", mc1.getNextHighestDepth());
mc1.text1.move(10, 80);
mc1.text1.setSize(340, 110);
mc1.text1.html = true;
mc1.text1.wordWrap = true;
mc1.text1.styleSheet = screenStyles;
mc1.text1.antiAliasType = "advanced";
mc1.text1.text ="on-screen version<br /> <br />" + textValue;

Once you’ve added this bit of code, test the movie (Control>Test Movie). You should see a small TextArea with red text, as shown in the following figure.

  • + Share This
  • 🔖 Save To Your Account