Hi,
I want to applying some filters to an image before I use it as an icon asset
for a button.
I tryied this:
**public function getButtonIcon(btn:String):Class
     {
      var result : Class;

      switch ( btn ) {
    case "cart":
    result = model.assets.cartIconBig;
    break;
    case "find":
    result = model.assets.searchIconBig;
    break;
   }
      var temp:BitmapAsset = BitmapAsset(result);
      temp.filters = [shadowFilter];

      return temp;
     }

then


icon="{getButtonIcon(*'find'*)}"



of Course I get a conversion type error becouse I return BitmapAsset instead
of a Class, I tryied many solutions but no luck.

How do I solve it?

Reply via email to