0 Replies Latest reply on Dec 30, 2010 8:31 PM by fantasticphil

    Automatically playing an s:AnimateColor effect

    fantasticphil

      Hello,

       

      I'm creating an animation effect on a fill in a custom skin (most of the script is from the panel skin.) I want to add an animation to the background fill but most examples that I have found say to create a button that starts the effect.  How do I just have the animation effect play automatically?

       

      I have a custom component called "Content Viewer" which extends the SkinnableContainer class.

       

      Heres the reference in the application:

          <components:ContentViewer skinClass="skins.CustomPanelSkin" top="100" right="250">
      

       

      And here is the important parts of the custom skin:

      <fx:Declarations>
              <s:AnimateColor id ="colorChange" target="background"
                              colorFrom="0x000000" colorTo="0x00FF00" repeatCount="5"  />
          </fx:Declarations>
      
      
        <!-- layer 2: background fill -->
              <s:Rect id="background" left="1" top="1" right="1" bottom="1">
                  <s:fill>
                      <s:SolidColor id="backgroundFill" color="#000000"/>
                  </s:fill>
              </s:Rect>
      

       

       

      Thanks for any help that you can provide.

       

      Best Regards,

       

      Phil