Document.settransformationpoint() – Adobe Extending Flash Professional CS4 User Manual
Page 181

159
EXTENDING FLASH CS4 PROFESSIONAL
Document object
Description
Method; inserts a string of text. If the optional parameters are not passed, the existing text selection is replaced; if the
Text object isn’t currently being edited, the whole text string is replaced. If only startIndex is passed, the string passed
is inserted at this position. If startIndex and endIndex are passed, the string passed replaces the segment of text starting
from startIndex up to, but not including, endIndex.
Example
The following example replaces the current text selection with “Hello World”:
var success = fl.getDocumentDOM().setTextString("Hello World!");
The following example inserts “hello” at position 6 of the current text selection:
var pass = fl.getDocumentDOM().setTextString("hello", 6);
The following example inserts “Howdy” starting at position 2 and up to, but not including, position 7 of the current
text selection:
var ok = fl.getDocumentDOM().setTextString("Howdy", 2, 7);
See also
document.setTransformationPoint()
Availability
Flash MX 2004.
Usage
document.setTransformationPoint( transformationPoint )
Parameters
transformationPoint
A point (for example,
{x:10, y:20}
, where
x
and
y
are floating-point numbers) that
specifies values for the transformation point of each of the following elements:
•
Shapes: transformationPoint is set relative to the document (0,0 is the upper left corner of the Stage).
•
Symbols: transformationPoint is set relative to the symbol’s registration point (0,0 is located at the registration
point).
•
Text: transformationPoint is set relative to the text field (0,0 is the upper left corner of the text field).
•
Bitmaps/videos: transformationPoint is set relative to the bitmap/video (0,0 is the upper left corner of the bitmap
or video).
•
Drawing objects, primitive ovals and rectangles, and groups: transformationPoint is set relative to the document
(0,0 is the upper left corner of the Stage). To set transformationPoint relative to the center point of the object,
primitive, or group, use
element.setTransformationPoint()
Returns
Nothing.