| Package | com.rubenswieringa |
| Class | public class CSSLoader |
| Inheritance | CSSLoader flash.events.EventDispatcher |
See also
| Property | Defined by | ||
|---|---|---|---|
| lastLoadedName : String [read-only]
The name of the last loaded stylesheet.
| CSSLoader | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructor.
| CSSLoader | ||
|
applyLastLoadedStyle(displayObj:DisplayObject, applyToChildren:Boolean = false):void
Applies the last loaded stylesheet to the specified DisplayObject.
| CSSLoader | ||
|
applyStyle(css:String, displayObj:*, applyToChildren:Boolean = false):void
Applies the specified stylesheet to the specified DisplayObject.
| CSSLoader | ||
|
getAllStyleNames():Array
Enlists all stylesheets (both loaded and still loading).
| CSSLoader | ||
|
getHTMLStyleSheet(css:String):StyleSheet
Returns a StyleSheet instance containing all the style declarations from the specified stylesheet.
| CSSLoader | ||
|
load(url:String, name:String = "", ... args):void
Loads a css file.
| CSSLoader | ||
|
loadString(raw:String, name:String, ... args):void
Similar to the load function, the difference being that loadString takes the String content, where load takes a String URL.
| CSSLoader | ||
|
removeStyle(name:String):Boolean
Removes the specified stylesheet (must have finished loading!).
| CSSLoader | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when a CSS file is loaded succesfully. | CSSLoader | |||
| Dispatched when there was an error while trying to load a CSS file. | CSSLoader | |||
| Dispatched when CSSLoader starts loading a CSS file. | CSSLoader | |||
| Dispatched when a parsing error occurs within CSSParser. | CSSLoader | |||
| Constant | Defined by | ||
|---|---|---|---|
| FAULT : String = "onCSSFault" [static]
| CSSLoader | ||
| LOAD_INIT : String = "onCSSLoadInit" [static]
| CSSLoader | ||
| RESULT : String = "onCSSLoaded" [static]
| CSSLoader | ||
| lastLoadedName | property |
lastLoadedName:String [read-only]The name of the last loaded stylesheet.
Implementation public function get lastLoadedName():String
| CSSLoader | () | constructor |
public function CSSLoader()Constructor.
| applyLastLoadedStyle | () | method |
public function applyLastLoadedStyle(displayObj:DisplayObject, applyToChildren:Boolean = false):voidApplies the last loaded stylesheet to the specified DisplayObject.
ParametersdisplayObj:DisplayObject — the DisplayObject to which to apply the stylesheet
|
|
applyToChildren:Boolean (default = false) — whether or not to apply the stylesheet to the DisplayObject's children (if any) [optional]
|
See also
| applyStyle | () | method |
public function applyStyle(css:String, displayObj:*, applyToChildren:Boolean = false):voidApplies the specified stylesheet to the specified DisplayObject.
Parameterscss:String — the name of the stylesheet (must have finished loading!)
|
|
displayObj:* — the DisplayObject to which to apply the stylesheet
|
|
applyToChildren:Boolean (default = false) — whether or not to apply the stylesheet to the DisplayObject's children (if any) [optional]
|
| getAllStyleNames | () | method |
public function getAllStyleNames():ArrayEnlists all stylesheets (both loaded and still loading).
ReturnsArray — an Array with the names of all stylesheets
|
| getHTMLStyleSheet | () | method |
public function getHTMLStyleSheet(css:String):StyleSheetReturns a StyleSheet instance containing all the style declarations from the specified stylesheet.
Parameterscss:String — Name identifier of a loaded stylesheet
|
StyleSheet — StyleSheet
|
| load | () | method |
public function load(url:String, name:String = "", ... args):voidLoads a css file.
Parametersurl:String — path of the css file
|
|
name:String (default = "") — name for the stylesheet within the class [optional]
|
|
... args — DisplayObject(s) to apply the loaded stylesheet to, note that the stylesheet will also be applied to the DisplayObjects' their children (use the RESULT event and applyStyle method if this is not what you want)
|
| loadString | () | method |
public function loadString(raw:String, name:String, ... args):voidSimilar to the load function, the difference being that loadString takes the String content, where load takes a String URL.
Parametersraw:String — the plain text stylesheet from a css file
|
|
name:String — name for the stylesheet within the class [optional]
|
|
... args — DisplayObject(s) to apply the loaded stylesheet to, note that the stylesheet will also be applied to the DisplayObjects' their children
|
See also
| removeStyle | () | method |
public function removeStyle(name:String):BooleanRemoves the specified stylesheet (must have finished loading!).
Parametersname:String — the name of the stylesheet to be removed
|
Boolean — whether or not the specified stylesheet was found
|
| loaded | event |
| load fault | event |
mx.events.Event
Dispatched when there was an error while trying to load a CSS file.
| load init | event |
| parse error | event |
mx.events.Event
Dispatched when a parsing error occurs within CSSParser.
See also
| FAULT | constant |
public static const FAULT:String = "onCSSFault"
| LOAD_INIT | constant |
public static const LOAD_INIT:String = "onCSSLoadInit"
| RESULT | constant |
public static const RESULT:String = "onCSSLoaded"