1067: Implicit coercion of a value of type spark.filters:ColorMatrixFilter to an unrelated type flash.filters:BitmapFilter.

1067: Implicit coercion of a value of type spark.filters:ColorMatrixFilter to an unrelated type flash.filters:BitmapFilter.

var filter:ColorMatrixFilter = new ColorMatrixFilter(grayscale);
var bitmap:BitmapData = bitmapImage.bitmapData.clone();
// line causing the error
bitmap.applyFilter(bitmapImage.bitmapData, bitmapImage.bitmapData.rect, new Point(), filter);

There is a conflict with flash.filters.ColorMatrixFilter and spark.filters.ColorMatrixFilter.

You must explicitly import the flash.filters class for applyFilter method to work.

import flash.filters.ColorMatrixFilter;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s