mx.styles

# CSSCondition - AS3 Flex

Package | mx.styles
Class | public class CSSCondition
Inheritance | CSSCondition Object

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Represents a condition for a CSSSelector which is used to match a subset of components based on a particular property.

Related API Elements

mx.styles.CSSConditionKind

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | kind : String [read-only] The kind of condition this instance represents. | CSSCondition
|  | specificity : int [read-only] Calculates the specificity of a conditional selector in a selector chain. | CSSCondition
|  | value : String [read-only] The value of this condition without any CSS syntax. | CSSCondition

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | CSSCondition(kind:String, value:String) Constructor. | CSSCondition
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | matchesStyleClient(object:IAdvancedStyleClient):Boolean Determines whether this condition matches the given component. | CSSCondition
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns a String representation of this condition. | CSSCondition
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### kind

property

`kind:String` [read-only]

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

The kind of condition this instance represents. Options are class, id and pseudo.

Implementation
`public function get kind():String`

Related API Elements

mx.styles.CSSConditionKind

### specificity

property

`specificity:int` [read-only]

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Calculates the specificity of a conditional selector in a selector chain. The total specificity is used to determine the precedence when applying several matching style declarations. id conditions contribute 100 points, pseudo and class conditions each contribute 10 points. Selectors with a higher specificity override selectors of lower specificity. If selectors have equal specificity, the declaration order determines the precedence (i.e. the last one wins).

Implementation
`public function get specificity():int`

### value

property

`value:String` [read-only]

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

The value of this condition without any CSS syntax. To get a String representation that includes CSS syntax, call the `toString()` method.

Implementation
`public function get value():String`
Constructor Detail

### CSSCondition

()
Constructor

`public function CSSCondition(kind:String, value:String)`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Constructor.

Parameters

| `kind:String` — The kind of condition. For valid values see the CSSConditionKind enumeration.
| `value:String` — The condition value (without CSS syntax).

Method Detail

### matchesStyleClient

()
method

`public function matchesStyleClient(object:IAdvancedStyleClient):Boolean`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Determines whether this condition matches the given component.

Parameters

| `object:IAdvancedStyleClient` — The component to which the condition may apply.

Returns

| `Boolean` — true if component is a match, otherwise false.

### toString

()
method

`public function toString():String`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Returns a String representation of this condition.

Returns

| `String` — A String representation of this condition, including CSS syntax.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00