KoolMoves AS3 API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class Image

Package | km.components
Class | public class Image
Inheritance | Image UIComponent flash.display.Sprite

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

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | duotone : Array The duotone property can be used to convert the colors of the component into duotone. | UIComponent
|  | enabled : Boolean Specifies if the component is enabled. If a component is disabled, it will be turned into grayscale and become partly transparent. | UIComponent
|  | height : 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
|  | toolTip : String Text to use as toolTip when ToolTip is enabled. | UIComponent
|  | width : Number | UIComponent
|  | x : Number | UIComponent
|  | y : Number | UIComponent

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | Image() | Image
|  | 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
|  | move(x:int, y:int, animationMode:int = 0, animationFrames:int = 12, easeInOut:Boolean = false):void Moves the component to the specified coordinates. | UIComponent
|  | setProperties(o:Object):void Sets a number of properties at once. | UIComponent
|  | 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
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined by
--- | --- | --- | ---
|  | animationComplete | The animationComplete event is broadcasted when an animated move is completed. | UIComponent

Property detail

minHeight | property

`minHeight:int` [read-only]

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

Implementation
`public function get minHeight():int`

minWidth | property |

`minWidth:int` [read-only]

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

Implementation
`public function get minWidth():int`

origHeight | property |

`origHeight:int` [read-only]

Returns the original height of the image.

Implementation
`public function get origHeight():int`

origWidth | property |

`origWidth:int` [read-only]

Returns the original width of the image.

Implementation
`public function get origWidth():int`

smoothing | property |

`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.

Last update : 04/05/2008