Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 535891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:45:52+00:00 2026-05-13T09:45:52+00:00

I have a flex component with 2 states – (ie no name / default)

  • 0

I have a flex component with 2 states – “” (ie no name / default) and “Transactional” – and a bunch of transitions to move from one state to the other.

There is a button to toggle between the two states which calls the following function when clicked

public function ToggleState():void
{
    if (this.currentState=="Transactional")
    {
        this.currentState = "";
    }
    else
    {
        this.currentState = "Transactional";
    }

}

Everything works as expected unless you click on the button whilst the component is changing from one state to the other. After that things start going strange – some components that would previously fade out, no longer disappear. Others no longer re-appear

I suspect this is because the transitions don’t complete properly and so the properties of the components being animated are not properly reset to the correct values.

I tried to put in some checks to tell if the state is changing (and hence disable the button whilst the transitions are playing) but the only events I could find to listen for were

enterState
currentStateChange
currentStateChanging

all of which are fired before the transitions are complete.

Does anyone know of any other suitable events to listen for or a better way of doing the state change?

UPDATE:

Here is the mxml I am using for the transitions

<transitions>
    <mx:Transition fromState="" toState="Transactional">
        <mx:Sequence>
            <mx:Parallel>
                <mx:AnimateProperty target="{Controller}" property="y" fromValue="-60" toValue="-1" duration="600" />
                <mx:AnimateProperty target="{Environment}" property="y" fromValue="156" toValue="46" />
                <mx:AnimateProperty target="{ProfitAndLoss}" property="y" fromValue="156" toValue="126" />
                <mx:AnimateProperty target="{Summary}" property="y" fromValue="156" toValue="56" />
                <mx:AnimateProperty target="{Assets_Container}" property="x" fromValue="266" toValue="246" />
                <mx:AnimateProperty target="{Liabilities_Container}" property="x" fromValue="425" toValue="505" />
                <mx:Fade target="{TransactionalBackgroundImage}" alphaFrom="0" alphaTo="1" />
            </mx:Parallel>
            <mx:AnimateProperty target="{Summary}" property="x" fromValue="42" toValue="256" />
        </mx:Sequence>
    </mx:Transition>
    <mx:Transition fromState="Transactional" toState="">
        <mx:Sequence>
            <mx:AnimateProperty target="{Summary}" property="x" fromValue="256" toValue="42" />
            <mx:Parallel>
                <mx:AnimateProperty target="{Controller}" property="y" fromValue="-1" toValue="-60" />
                <mx:AnimateProperty target="{Environment}" property="y" toValue="156" fromValue="46" />
                <mx:AnimateProperty target="{ProfitAndLoss}" property="y" toValue="156" fromValue="126" />
                <mx:AnimateProperty target="{Summary}" property="y" toValue="156" fromValue="56" />
                <mx:AnimateProperty target="{Assets_Container}" property="x" fromValue="246" toValue="266" />
                <mx:AnimateProperty target="{Liabilities_Container}" property="x" fromValue="505" toValue="425" />
                <mx:Fade target="{TransactionalBackgroundImage}" alphaFrom="0" alphaTo="0" />
            </mx:Parallel>
        </mx:Sequence>
    </mx:Transition>
</transitions>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:45:53+00:00Added an answer on May 13, 2026 at 9:45 am

    The currentState property changes instantly, I’m pretty sure it’s the transitions that cause the trouble (been there, done that ;-). If you click too fast, you have two concurrently running effects changing the same set of values, yielding an undefined result. Also, effectEnd event handlers on your effects will fire in the middle of another running effect. You might try the end() method on your effect instances to immediately end an effect before starting the next, this also sets all attributes to their final values and triggers effectEnd. If that does not help, can you post some of your effect code?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 324k
  • Answers 324k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is a pattern that is used in all library… May 14, 2026 at 1:14 am
  • Editorial Team
    Editorial Team added an answer The syntax of Array.splice is: yourArray.splice(index, howmany, element1, /*.....,*/ elementX);… May 14, 2026 at 1:14 am
  • Editorial Team
    Editorial Team added an answer Resharper allows to change variable name in views. There is… May 14, 2026 at 1:14 am

Related Questions

So I have a flex tree component with a xmllistcollection as it's data provider.
I build and maintain a set of Flash components that is distributed to publishers
I am accessing custom UIComponent via SWC file from Flex 3. This component works
I'm building my first Flex custom component, in Flex 3. It is a data
I'm trying to build a simple component extending spark.components.Group to have a background color,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.