views:

17

answers:

1

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.

+1  A: 

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.

James Hay