4 Replies Latest reply on Sep 2, 2009 8:41 AM by Chet Haase

    How to do Add/Remove Effects in Spark?

    viatropos Level 1

      How do you do add/remove effects in Spark?

        • 1. Re: How to do Add/Remove Effects in Spark?
          Chet Haase Level 3

          AddAction/RemoveAction - this will handle adding/removing either GraphicElements or components

           

          Chet.

          • 2. Re: How to do Add/Remove Effects in Spark?
            viatropos Level 1

            I mean for like a SkinnableDataContainer, when an item/renderer is added run a move then a fade, not manually adding them.

             

            <s:Group xmlns:...>

             

                 <s:states>

                      <mx:State name="one"/>

                      <mx:State name="two"/>

                 </s:states>

             

                 <s:transitions>

                      <mx:Transition fromState="one" toState="two">

                           <s:Fade alphaFrom="0" alphaTo="1" target="{panel}"/>

                      </mx:Transition>

                 </s:transitions>

             

                 <s:Panel id="panel" includeIn="two"/>

             

            </s:Group>

             

            Something like the above doesn't even work either.

             

            Thanks for your help,

            Lance

            • 3. Re: How to do Add/Remove Effects in Spark?
              viatropos Level 1

              There's a long way to go for those to be ready it looks like .

               

              Here's what I think I should do:

               

              1) Refactor the AddItems IOverride object, maybe put all of those "addItemsToContainer"/"addItemsToContentHolder"/"getObjectIndex" methods into a ContainerUtil.as class so we can use them in other places.

              2) Refactor the EffectManager so the Removed functionality works with IVisualElement and the ContainerUtil.

              3) Conditionally dispatchEvent(new Event("removed")) on any children that hasEventListener("removed"), in the AddItems (same with the "added" event).

               

              That would work for simple cases like the Panel and Group, not for lists though, and not for layouts (animating the layout adjustment).

               

              Best,
              Lance

              • 4. Re: How to do Add/Remove Effects in Spark?
                Chet Haase Level 3

                Not sure what you mean by this comment, but there's definitely work to be done (after this release) in the area of data effects and container/layout effects in general.

                 

                Chet.