Packagekm.components
Classpublic class Image
InheritanceImage Inheritance UIComponent Inheritance flash.display.Sprite

The Image component class is used for bitmap images with the ability to assign a scaling grid.



Public Properties
 PropertyDefined by
 Inheritedduotone : Array
The duotone property can be used to convert the colors of the component into duotone.
UIComponent
 Inheritedenabled : Boolean
Specifies if the component is enabled.
If a component is disabled, it will be turned into grayscale and become partly transparent.
UIComponent
 Inheritedheight : Number
UIComponent
  minHeight : int
[read-only] Returns the minimum height of the image based on its scaling grid.
Image
  minWidth : int
[read-only] Returns the minimum width of the image based on its scaling grid.
Image
  origHeight : int
[read-only] Returns the original height of the image.
Image
  origWidth : int
[read-only] Returns the original width of the image.
Image
  smoothing : Boolean
[write-only] Sets the way the scaling grid is used.
Image
 InheritedtoolTip : String
Text to use as toolTip when ToolTip is enabled.
UIComponent
 Inheritedwidth : Number
UIComponent
 Inheritedx : Number
UIComponent
 Inheritedy : Number
UIComponent
Public Methods
 MethodDefined by
  
Image
 Inherited
clone():*
Returns a clone of the component.
The skin of the component is cloned but other things like the text of a label or the items of a list aren't.
UIComponent
 Inherited
move(x:int, y:int, animationMode:int = 0, animationFrames:int = 12, easeInOut:Boolean = false):void
Moves the component to the specified coordinates.
UIComponent
 Inherited
setProperties(o:Object):void
Sets a number of properties at once.
UIComponent
 Inherited
setSize(w:int, h:int):void
Sets the size width and height.
UIComponent
  
setSkin(assetName:String, usePrefix:Boolean = true):void
Sets the skin asset.
Image
Events
 EventSummaryDefined by
 Inherited The animationComplete event is broadcasted when an animated move is completed.UIComponent
Property detail
minHeightproperty
minHeight:int  [read-only]

Returns the minimum height of the image based on its scaling grid.

Implementation
    public function get minHeight():int
minWidthproperty 
minWidth:int  [read-only]

Returns the minimum width of the image based on its scaling grid.

Implementation
    public function get minWidth():int
origHeightproperty 
origHeight:int  [read-only]

Returns the original height of the image.

Implementation
    public function get origHeight():int
origWidthproperty 
origWidth:int  [read-only]

Returns the original width of the image.

Implementation
    public function get origWidth():int
smoothingproperty 
smoothing:Boolean  [write-only]

Sets the way the scaling grid is used.

Implementation
    public function set smoothing(value:Boolean):void
Constructor detail
Image()constructor
public function Image()
Method detail
setSkin()method
public function setSkin(assetName:String, usePrefix:Boolean = true):void

Sets the skin asset. The assetName string can contain up to four parameters, separated by the # character. The first parameter is the assetName of the base image. The second one is its scaling grid. The scaling grid works similar to the scale9Grid of a MovieClip. The third parameter is an optional icon asset. By default this will be displayed on top of the base image, centered and not scaled. The fourth parameter is an integer value that gives extra control over how the icon image is used. When bit 3 is set, the image will be placed behind the base image and repeated to fill the size of the image. When bit 2 is set, the icon image is mirrored. Bits 1 and 0 specify how many times the icon image should be rotated 90 degrees.

Parameters
assetName:String — the string specifying the asset and how to use it.
 
usePrefix:Boolean (default = true) — specifies if the namePrefix property of the AssetManager should be used.

See also

The km.core.AssetManager class for additional info on assets.

Example
 myImage.setSkin('image'); // image without a scaling grid
 myImage.setSkin('image#5,5,12,12#icon#1'); // image with scaling grid (5,5,12,12) and icon 90 degrees rotated.