03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

style:Object - An object that describes the style, or null.<br />

Example<br />

The following example adds a style named emphasized to the StyleSheet myStyleSheet. The<br />

style includes two style properties: color <strong>and</strong> fontWeight. The style object is defined with<br />

the {} operator.<br />

myStyleSheet.setStyle("emphasized", {color:'#000000',fontWeight:'bold'});<br />

You could also create a style object using an instance of the Object class, <strong>and</strong> then pass that<br />

object (styleObj) as the style parameter, as the next example shows:<br />

import TextField.StyleSheet;<br />

var my_styleSheet:StyleSheet = new StyleSheet();<br />

var styleObj:Object = new Object();<br />

styleObj.color = "#000000";<br />

styleObj.fontWeight = "bold";<br />

my_styleSheet.setStyle("emphasized", styleObj);<br />

delete styleObj;<br />

var styleNames_array:Array = my_styleSheet.getStyleNames();<br />

for (var i=0;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!