User Guide
TextField.StyleSheet.transform() 869
TextField.StyleSheet.transform()
Availability
Flash Player 7.
Usage
styleSheet.transform(style:Object) : TextFormat
Parameters
style
An object that describes the style, containing style rules as properties of the object, or
null.
Returns
A TextFormat object containing the result of the mapping of CSS rules to text format properties.
Description
Method; extends the CSS parsing capability.
Advanced developers can override this method by extending the TextField.StyleSheet class. For
more information, see “Creating subclasses” in Using ActionScript in Flash.
Example
The following code subclasses this method:
class advCSS extends TextField.StyleSheet {
// override the transform method
function transform(style:Object):TextFormat {
for (var z in style) {
if (z == "margin") {
style.marginLeft = style[z];
style.marginRight = style[z];
delete style[z];
break;
}
}
return super.transform(style);
}
}
// end class definition