| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
GetBitmapData |
|
|
| Property | Defined By |
|---|---|
|
target
: Sprite
Optional to set a target. |
GetBitmapData |
|
_bitMap
: Bitmap
Used when data are retrieved from a Bitmap. |
GetBitmapData |
|
_xPos
: int
Sets the x value to retrive color information. |
GetBitmapData |
|
_yPos
: int
Sets the y value to retrive color information. |
GetBitmapData |
| Method | Defined By |
|---|---|
|
GetBitmapData.getInstance()
Creates a new instance of the GetBitmapData class. |
GetBitmapData |
|
getColorBitmap():String
Function returns the color information of a Bitmap at default 0, 0 position when _xPos and _yPos is not set. requires to set the _bitMap property. |
GetBitmapData |
|
getColorSprite(target:Sprite):String
Function returns the color information of a Sprite at default 0, 0 position when _xPos and _yPos is not set. |
GetBitmapData |
|
multiplyColor(_root:Object, red:Number=1, green:Number=1, blue:Number=1, _alpha:Number=1, xPos:int=0, yPos:int=0, _width:int=100, _height:int=100, _replace:Boolean=false):void
Function creates a new Bitmap using Multipliers and places it inside a MovieClip/Sprite or replaces it. |
GetBitmapData |
|
offsetColor(_root:Object, red:Number=1, green:Number=1, blue:Number=1, _alpha:Number=1, xPos:int=0, yPos:int=0, _width:int=100, _height:int=100, _replace:Boolean=false):void
Function creates a new Bitmap using Offset colors and places it inside a MovieClip/Sprite or replaces it. |
GetBitmapData |
| Property Detail |
|---|
|
target
property
target:Sprite [read-write] Optional, will define a target, which is used in multiplyColor and multiplyColor to set target width and height. There is no default value. . Implementationpublic static function get target():Spritepublic static function set target(value:Sprite):void |
|
_bitMap
property
_bitMap:Bitmap [read-write] Is required when used in conjunction with the getColorBitmap. An error will be thrown when _bitMap is not defined. There is no default value. . .Implementationpublic static function get _bitMap():Bitmappublic static function set _bitMap(value:Bitmap):void |
|
_xPos
property
_xPos:int [read-write] Sets the x value to retrieve color information. The default value is 0. .Implementationpublic static function get _xPos():intpublic static function set _xPos(value:int):void |
|
_yPos
property
_yPos:int [read-write] Sets the y value to retrieve color information. The default value is 0. .Implementationpublic static function get _yPos():intpublic static function set _yPos(value:int):void |
| Constructor Detail |
|---|
|
GetBitmapData () Constructor
public function GetBitmapData(mp:MakePrivate) |
| To initialize an instance use GetBitmapData.getInstance(). |
| Method Detail |
|---|
|
getColorBitmap() method
Function returns the color information of a Bitmap at default 0, 0 position when _xPos and _yPos is not set. Requires to set the _bitMap property. |
| Method Detail |
|
getColorSprite() method
Function returns the color information of a Sprite at default 0, 0 position when _xPos and _yPos is not set. |
Parameters
|
| Method Detail |
|
multiplyColor() method
This method creates a new Bitmap using the Multiplier color values. When _replace is false, the Bitmap is placed inside the Object defined by _root . Otherwise the Bitmap replaces the _root object. The coordinates for the new Bitmap are given by xPos and yPos , which by default are 0. |
Parameters
|
|
offsetColor() method
This method creates a new Bitmap using the Multiplier color values. When _replace is false, the Bitmap is placed inside the Object defined by _root . Otherwise the Bitmap replaces the _root object. The coordinates for the new Bitmap are given by xPos and yPos , which by default are 0. |
Parameters
|
| Event Detail |
|---|
| N/A |
| Examples |
|---|
EXAMPLE: Create a new fla file and name it GetBitmapData.fla. Place the fla in the same folder as the biz folder. Place two MovieClips on the main timeline with the identifier mc and mc1. Then create an Actionscript file, name it Getbitmapdata.as and place this script.
package
{
import flash.display.Sprite;
import flash.display.BitmapData;
import flash.display.Bitmap;
import biz.flashscript.bitmap.GetBitmapData;
import flash.display.MovieClip;
public class Getbitmapdata extends Sprite
{
public var mc:MovieClip;
public var mc1:MovieClip;
public function Getbitmapdata ():void
{
var gp:GetBitmapData = GetBitmapData.getInstance();
GetBitmapData._x = 60;
GetBitmapData._y = 0;
trace ("Color: "+GetBitmapData.getColorSprite(mc));
//
GetBitmapData.target = mc;
GetBitmapData._x = 0;
GetBitmapData._y = 0;
GetBitmapData.multiplyColor(mc1);
trace ("ColorBitmap: "+GetBitmapData.getColorBitmap());
GetBitmapData.offsetColor (mc1, 255, 100, -210, 0.5, 10, 10, 100, 20, false);
trace ("ColorBitmap: "+GetBitmapData.getColorBitmap());
}
}
}
|