TextField.StyleSheet.transform()
Availability
Flash Player 7.
Usage
styleSheet.transform(style:Object) : TextFormat
Parameters
An object that describes the style, containing style rules as properties of the object, or
style
.
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
TextField.StyleSheet.transform()
869
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?