Can't apply filter to Sprite
I have this simple class:
import spark.effects.GlowFilter;
public class Letter extends Sprite {
private var glowFilter:GlowFilter = new开发者_开发知识库 GlowFilter();
public function Letter() {
filters = [glowFilter];
}
}
And in gaves "Error #2005: Parameter 0 - incorrect type. Should be type Filter" in runtime. If I change parent class to UIComponent everything works great. But I do not need all UIComponent functionality, I need just that damn filter works. =)
So, the question is what is the problem? Why it is not working with "Sprite" as parent class?
Using Flex 4.1.
You are trying to apply a flex specific filter to a non flex based object.
Try changing the import to
import flash.filters.GlowFilter;
This will use the standard flash filter instead.
精彩评论