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

  • SEARCH
  • Home
  • 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 6231169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:53:00+00:00 2026-05-24T09:53:00+00:00

I am trying to understand how to make Flex transitions behave in an attractive

  • 0

I am trying to understand how to make Flex transitions behave in an attractive smooth manner. I can’t get them to work without them appearing extremely choppy.

I have attached a silly demonstration application to illustrate this. It shows a List which has a custom ItemRenderer. When an item in the list is selected, the TextInput should slowly grow wider.
When an item is deselected, the TextInput should slowly shrink.

There are 2 issues with this implementation which make it look ugly. These can be seen by clicking about on the List to make the items animate. These issues are:

  1. When an item is animating but enters the “hovered” state, the TextInput snaps back to the small size. Why is this?

  2. When an item has its animation interrupted it snaps to either the largest or smallest size and then starts animating, rather than continuing the animation from its current value. Why?

Any help greatly appreciated.

Thanks,
Phil
TestApplication.mxml

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/mx"
           initialize="init(event)"
           minWidth="900" minHeight="600">

<fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        import mx.events.FlexEvent;

        protected function init(event:FlexEvent):void {
            var ac:ArrayCollection = new ArrayCollection();
            ac.addItem("A1");
            ac.addItem("B2");
            ac.addItem("C3");
            myList.dataProvider = ac;
        }
    ]]>
</fx:Script>

<s:List id="myList" width="410" height="350" itemRenderer="MyItemRenderer" requireSelection="true"/>
</s:Application>

MyItemRenderer.mxml

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
            xmlns:s="library://ns.adobe.com/flex/spark" 
            xmlns:mx="library://ns.adobe.com/flex/mx" 
            autoDrawBackground="true">
<s:states>
    <s:State name="normal" />
    <s:State name="hovered" />
    <s:State name="selected" />
</s:states>

<s:transitions>
    <s:Transition fromState="*" toState="selected" id="itemHasBeenSelected" >
        <mx:AnimateProperty property="width" toValue="300" duration="3000" target="{textInput}" />
    </s:Transition>
    <s:Transition fromState="selected" toState="*" id="itemHasBeenUnselected">
        <mx:AnimateProperty property="width" toValue="100" duration="3000" target="{textInput}" />
    </s:Transition>
</s:transitions>

<s:Group width="100%">
    <s:Label text="{data}" color.selected="red" color.normal="black"/>
    <s:TextInput x="100" id="textInput" width="100"/>
</s:Group>

</s:ItemRenderer>
  • 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-24T09:53:01+00:00Added an answer on May 24, 2026 at 9:53 am

    To answer your questions, but in the opposite order:

    (2) You want to use the autoReverse capability which is a property of the spark Transition. You could do this by just adding autoReverse="true" to your current transitions, but I’d also suggest simplifying them to the following single Transition, and use the Spark Resize effect instead of the MX AnimateProperty:

    <s:Transition autoReverse="true">
      <s:Resize target={textInput}" duration="3000"/>
    </s:Transition>
    

    Then, if you define the values for the width on the component itself, the transition will take care of the rest:

    <s:TextInput x="100" id="textInput" width.normal="100" width.selected="300"/>
    

    That should take care of the “popping” between the values of the normal and selected states. As for the hovering issue:

    (1) If you check out Chet Haase’s video on Adobe TV on Auto-Reversing Transitions, he states that one of the major caveats or shortfalls in the auto-reversing architecture is that it only handles transitions from A->B and B->A. If you try to attempt to transition to a third state (in your case “hovered”), the auto-reversing will fail. Unfortunate, but at least we have the auto-reversing, which wasn’t even an option in Flex 3.

    HOWEVER, there is a workaround, at least for the simple ItemRenderer that you posted: Try removing the hovered state altogether.

    <!--s:State name="hovered" /-->
    

    As long as you don’t plan on doing anything else special in the ItemRenderer during a hovered state, this should work fine, and it will get rid of the popping between the states.

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

Sidebar

Related Questions

I'm trying to understand how to get librsync to work (ie. make signature/make delta/patch)
Im trying to understand how class generics work and this bit just doesnt make
I'm trying to understand how to make a get a file from my project
I'm trying to understand how to make scheduled calls to FQL queries without an
new to Java programming, I am just trying to understand how I can make
My question is a bit tricky, I am trying best to make you understand
I'm still picking up ObjC and I'm just trying to make sure I understand
I'm trying to understand how these two are connected. Every time you make a
I am trying to understand how to best make use of blocks in my
im trying to understand the get and set properties for fields, and run in

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.