René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Altering text with Action Script [Ming wrapper example]

This examples demonstrates how text can be altered with Action Script. A TextField (variable name: text) is created whose initial text is, well, initial text.
An Action is added to the movie that changes the text of the TextField to changed text.
This flash movie was created with the following program.
AlterText.cpp
#include "SWFMovie.h"

int main() {
  Movie     movie ("AlterText.swf", 400, 100);
  TextField text(Font("Verdana.fdb"), 24, 40, 107, "initial text", 0x40, 0x60, 0x80, 0xff);

  text.ReadOnly(true);

  DisplayItem  iText= movie.Add(text);
  iText.Name("t");

  movie.Add(Action("_root.t.text='changed text';"));
  movie.NextFrame();

  return 0;
}
This is one of a series of examples that demonstrates the C++ ming wrapper classes. Other examples can be found here.