OK, to apply a filter to a frame, you need to use the command setFiltersAtFrame(). If you refer to the documentation, there are described all filter object properties. So, if we want to apply, a new filter, we need to manually construct the filter object and to push it to the filters array. For example:
var dom = an.getDocumentDOM();
var tl = dom.getTimeline();
var layer = tl.layers[ tl.currentLayer ];
var myFilter = {
"name": "glowFilter",
"enabled": true,
"angle": 45,
"blurX": 4,
"blurY": 4,
"distance": 4,
"color": "#FF0000",
"quality": "low",
"inner": false,
"knockout": false,
"hideObject": false,
"strength": 100
};
// In order to keep the filters already applied to the frame,
// first we get the existing filters array.
var filters = layer.getFiltersAtFrame( tl.currentFrame ) || [];
// Put the new filter to the array
filters.push( myFilter );
// And apply modified array back to the frame
layer.setFiltersAtFrame( tl.currentFrame, filters );
// Set the blend mode
layer.setBlendModeAtFrame( tl.currentFrame, "Normal" );
- Vlad: UX and graphic design, Flash user since 1998Member of Flanimate Power Tools team - extensions for character animation