DisplayUtils

Kind of class: public class
Package:
Inherits from:
  • none
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.utils.DisplayUtils
File last modified: Tuesday, 24 Augustus 2010, 17:26:45
Utilities for Display Objects

Summary

Class methods
  • removeAllChildren (container:Sprite) : void
    • Removes all children of target sprite.
  • hideAllChildren (container:Sprite) : void
    • Sets visible property to false for all children of target sprite.
  • scaleToFit (target:Sprite, scaleWidth:Number, scaleHeight:Number) : void
    • Scales target sprite to fit within a given width/height
  • scaleToFill (target:Sprite, scaleWidth:Number, scaleHeight:Number) : void
    • Scales target sprite to fill a given width/height
  • addOutline (target:Sprite, outlineColor = 0x000000, outlineAlpha = .5) : void
    • Adds rectangle outline to the top level of a target sprite sized to its width/height
  • addLink (target:Sprite, url:String, window:String = "_blank")
    • Adds hyperlink to target sprite
  • addBackgroundShapeBehind (target:Sprite, backgroundColor = 0x000000, backgroundAlpha = 1) : void
    • Adds rectangle shape to bottom level target sprite
  • traceRuntimeFonts () : void
    • Creates a trace output of the names of all fonts embedded at runtime
  • getRuntimeFonts () : Array
    • Creates a trace output of the names of all fonts embedded at runtime
  • getColorCodeFromString (colorString:String) : uint
    • Corrects color codes to flash uintConverts #000000 to 0x000000

Class methods

addBackgroundShapeBehind

static function addBackgroundShapeBehind(target:Sprite, backgroundColor = 0x000000, backgroundAlpha = 1) : void

Adds rectangle shape to bottom level target sprite

addOutline

static function addOutline(target:Sprite, outlineColor = 0x000000, outlineAlpha = .5) : void

Adds rectangle outline to the top level of a target sprite sized to its width/height

getColorCodeFromString

static function getColorCodeFromString(colorString:String) : uint

Corrects color codes to flash uintConverts #000000 to 0x000000

getRuntimeFonts

static function getRuntimeFonts() : Array

Creates a trace output of the names of all fonts embedded at runtime

hideAllChildren

static function hideAllChildren(container:Sprite) : void

Sets visible property to false for all children of target sprite.

removeAllChildren

static function removeAllChildren(container:Sprite) : void

Removes all children of target sprite.

scaleToFill

static function scaleToFill(target:Sprite, scaleWidth:Number, scaleHeight:Number) : void

Scales target sprite to fill a given width/height

scaleToFit

static function scaleToFit(target:Sprite, scaleWidth:Number, scaleHeight:Number) : void

Scales target sprite to fit within a given width/height

traceRuntimeFonts

static function traceRuntimeFonts() : void

Creates a trace output of the names of all fonts embedded at runtime