1 Reply Latest reply on May 20, 2011 4:47 PM by Jason Szeto

    Why I cannot put filters in a group container?

    cpthk

      I am trying to design a custom group container. This is my code below. I have a Group openning tag and a GlowFilter inside the declarations. When I run the code, it gives me error

      ArgumentError: Error #2005: Parameter 0 is of the incorrect type. Should be type Filter.
      

       

      I have no idea what went wrong. The code compiles fine, but not able to run. The workaround is change the Group to BorderContainer or remove the filters, but I just don't see why Group has a problem with it. Can anyone help?

      I have attached the simplest project file. Please check, http://www.mediafire.com/?dq1mdsm2kmbp7wl

       

      Thanks.

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
                 xmlns:s="library://ns.adobe.com/flex/spark" 
                 xmlns:mx="library://ns.adobe.com/flex/mx">
           
           <fx:Script>
                <![CDATA[
                     import spark.core.MaskType;
                ]]>
           </fx:Script>
           
           <fx:Declarations>
                <!-- Place non-visual elements (e.g., services, value objects) here -->
                <s:GlowFilter id="gF" blurX="12" blurY="12" color="#000000"/>
           </fx:Declarations>
           
           <s:Label text="test" filters="{[gF]}"/>
      </s:Group>