Skip to main content
Known Participant
September 7, 2009
Question

Any info on Layout Effects?

  • September 7, 2009
  • 1 reply
  • 1067 views

Hey Chet,

Have you done any work in supporting layout effects, or data effects, in Spark?  If not, any plans or ideas on how you might do them?

Here are some issues I've run into:

1) Infinite loops for the layout/effect cycle.  If the Effect is called in the layouts "updateDisplayList" method, after the Effect finishes (these are all Animate extending effects), it sets "autoLayout" to true, which causes the layout to run again and again.

2) If I prevent that, by commenting out the code, the x/y/z values in the transform are never set to rounded numbers so "changedXY" is run cyclically.

3) The explicit/percent/measured widths don't seem to function quite right when running effects because the effect sets x/y/z/width/height directly, rather than through "setActualSize", "setLayoutBoundsSize", "move", etc.  I have set up a layout animation system with TweenMax that uses these methods to update position and size in the layouts and it works perfectly, without excess events, without messing up measured/percent widths, and without cyclic layout calls.

One other pretty nice way of making it so we could easily extend "tweening" in general, is how TweenMax did their plugin system.  I would like to be able to use the Animation system in Spark to run methods on the animation update, so I could easily implement a "SetActualSizePlugin", a "TransformAroundPlugin", etc., that updated 2+ properties through a method, but that seems pretty tough right now: I'd have to create a huge effect.  I noticed this is how the ScrollBar is doing its animation, but maybe there's a way to make it more extensible?

Other than that, are there plans to do BitmapData "snapshots" in effects like Efflex does it?  Maybe for optimizing Fade, Resize, etc.?  If not, that would be a fun little project.

Thanks for your time,

Lance

This topic has been closed for replies.

1 reply

viatroposAuthor
Known Participant
October 20, 2009

Anything?