Is there a way to take a single .mxml component and make multiple copies of it?
I've got an app where the user can page through various screens. Each screen should fade out and slide away while the next one slides in. There has to be two copies active at any given time because the user should see both the old and new animating simultaneously. I've got it working with an ActionScript class but positioning elements, setting properties, etc, is much harder than with an MXML component.
For example, I've got an Image object, but I can't set the horizontalAlign, verticalAlign properties like you can in MXML. They just don't seem to be exposed in ActionScript. Or maybe I'm doing it wrong?
What's the best/simplest way to achieve what I want?
horizontalAlign, verticalAlign etc. are style properties, so in AS you need setStyle()
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
Flex / AIR Development, Training, and Support Services
Do hideEffect and showEffect do what you want? I believe there is a Move effect you could use.
The problem with the effects is they only work on a single component. I need to have two components (that are basically the same thing) moving around simultaneously. I have got everything working with pure ActionScript classes. They just are not as easy to set up as MXML components.