Hello All,
I have a PNG imported into my library and exported for use in Action script. On the stage, I have a swatchFill movie clip. Currently I have code that will transform the fill to a solid color, however I’m getting into metallic swatches and the colorTransform function will no longer work.
Here is my existing code:
...
...
public var swatchFill:MovieClip;
...
...
public function setColor($colorValue:uint, $colorName:String = null, $colorNum:int = -1 ):void {
_colorValue = $colorValue;
if ($colorName != null)
_colorName = $colorName;
if ($colorNum >= 0)
_colorNumber = $colorNum;
var tmpTransform:ColorTransform = new ColorTransform();
tmpTransform.color = $colorValue;
swatchFill.transform.colorTransform = tmpTransform;
}
I’ve created a new BitmapData consisting of my linked bitmap, however I don’t know how to apply this image to the swatchFill movie clip.
var imgBD:BitmapData=new Metallic_blue(1,1);
var metallicBlueImage:Bitmap=new Bitmap(imgBD);
// Below code produces a compiler error!!
swatchFill.beginBitmapFill(imgBD, null, true);
Any help will be greatly appreciated.
Thanks!