In previous examples you applied effects by declaring an effect, assigning a target or multiple targets as an
Array to that effect, and then calling the effect’s
play() method. With filters, however, while you define their instances in your Declarations section, you bind them directly to your visual components as members of their
filters property, which is also an
Array. This is similar in concept, yet backward compared to the previous effects examples you’ve seen.
Example 14-17. Applying a DropShadowFilter effect to the FXG graphic
<?xml version="1.0" encoding="utf-8"?>
<fx:Declarations><s:DropShadowFilter id="dropShadow" distance="12"/>
Figure 14-9. The triangle graphic with a DropShadowFilter
This example uses the FXG graphic we discussed in the sidebar “FXG Graphics” on page 288. If you want to keep things simple by using our graphic, just download it off the Web and save it in your project’s src directory. You can get it ...