The SimpleCSSValuesImpl class implements a minimal set of
CSS lookup rules that is sufficient for most applications.
It does not support attribute selectors or descendant selectors
or id selectors. It will filter on a custom -flex-flash
media query but not other media queries. It can be
replaced with other implementations that handle more complex
selector lookups.
Returns a new instance based on the value for a given object based on a property name,
and optionally, the current state, and a set of property value pairs.
A method that stores a value to be shared with other objects.
SimpleCSSValuesImpl
Property Detail
inheritingStyles
property
public static var inheritingStyles:Object
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
A map of inheriting styles
values
property
public var values:Object
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
The map of values. The format is not documented and it is not recommended
to manipulate this structure directly.
Constructor Detail
SimpleCSSValuesImpl
()
Constructor
public function SimpleCSSValuesImpl()
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
Constructor.
Method Detail
addRule
()
method
public function addRule(ruleName:String, values:Object):void
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
Add a style rule like a class selector.
Parameters
ruleName:String — The name of the rule like '.myClassSelector'.
values:Object — Name/value pairs.
convertColor
()
method
public function convertColor(value:Object):uint
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
Converts a color value into a uint.
Parameters
value:Object — A string for a color. Typically it is
a color value like #ffffff or "red" in some cases.
Returns
uint
generateCSSStyleDeclarations
()
method
public function generateCSSStyleDeclarations(factoryFunctions:Object, arr:Array):void
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
Process the encoded CSS data into data structures. Usually not called
directly by application developers.
Parameters
factoryFunctions:Object
arr:Array
getInstance
()
method
public function getInstance(valueName:String):Object
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
Returns a shared instance, instantiating the shared instance if
it doesn't exist. Often used to share "managers"
Parameters
valueName:String — The name of a shared instance. Often, the fully
qualified class name is used.
Returns
Object — The shared instance.
getValue
()
method
public function getValue(thisObject:Object, valueName:String, state:String = null, attrs:Object = null):*
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
Returns a value for a given object based on a property name,
and optionally, the current state, and a set of property value pairs.
Parameters
thisObject:Object — The object to get the value for.
valueName:String — The name of a property. e.g. fontFamily, color, etc.
state:String (default = null) — The name of a state. e.g. hovered, visited
attrs:Object (default = null) — A map of property value pairs that may affect the returned value.
Returns
* — A value or undefined
init
()
method
public function init(mainClass:Object):void
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
MXML Documents that support <fx:Style> blocks should call
init to install the styles for each instance.
Parameters
mainClass:Object — An instance that may have styles from an <fx:Style> block.
newInstance
()
method
public function newInstance(thisObject:Object, valueName:String, state:String = null, attrs:Object = null):*
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
Returns a new instance based on the value for a given object based on a property name,
and optionally, the current state, and a set of property value pairs. This is a way
to avoid using the Class type in AS code.
Parameters
thisObject:Object — The object to get the value for.
valueName:String — The name of a property. e.g. fontFamily, color, etc.
state:String (default = null) — The name of a state. e.g. hovered, visited
attrs:Object (default = null) — A map of property value pairs that may affect the returned value.
Returns
* — A value or undefined
parseStyles
()
method
public function parseStyles(styles:String):Object
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
Converts an HTML-like style format into an object.
Parameters
styles:String — A string, such as "color:red;fontSize:10px".
Returns
Object
setValue
()
method
public function setValue(thisObject:Object, valueName:String, value:*):void
Language Version :
ActionScript 3.0
Product Version :
FlexJS 0.0
Runtime Versions :
Flash Player 10.2, AIR 2.6
A method that stores a value to be shared with other objects.
It is global, not per instance. Fancier implementations
may store shared values per-instance.
Parameters
thisObject:Object — An object associated with this value. Thiis
parameter is ignored.
valueName:String — The name or key of the value being stored.