Friday, March 13, 2009

GTweenFilter Error - no filter at index

I'm not sure how many people are playing with Flash Player 10. I'm enjoying this current project. It is all being coded via Textmate using the Player 10 API. I'm currently using GTween for all my animation/transitions and have a simple tip for adding GTweenFilters to dynamic objects.

If you're trying to apply a GTweenFilter effect on a programmatic object you may get a 'no filter at index [number]'. Don't forget the filter for your object hasn't been created yet. You need to create a new filter and add it to your objects filters array. Here is a short example:

clip.filters = [ new BlurFilter( 0, 0, BitmapQuality.MEDIUM ) ];
new GTweenFilter( clip, 0.6, { blurX: 40, blurY: 40 }, { reflect:true, ease:Sine.easeInOut } );

No comments: