Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-21819

<s:AnimateColor> with colorPropertyName does not pick up to and from color states during transitions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • Adobe Flex SDK Previous
    • Spark: Effects
    • None
    • Affected OS(s): Windows
      Affected OS(s):
      Browser: Firefox 3.x
      Language Found: English

    Description

      Steps to reproduce:

      1. Compile and run the following code:

      <?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/halo"
      currentState="state1" >

      <fx:Script>
      <![CDATA[
      protected function clickHandler():void

      { currentState == "state1"? currentState="state2" : currentState="state1"; }

      ]]
      >
      </fx:Script>

      <s:states>
      <s:State name="state1" />
      <s:State name="state2" />
      </s:states>

      <s:transitions>
      <s:Transition fromState="" toState="">
      <s:AnimateColor duration="1000" target="

      {myButton}" colorPropertyName="baseColor"/>
      </s:Transition>
      </s:transitions>

      <!-- ***************** workaround ******************* -->
      <!--<s:transitions>
      <s:Transition fromState="state1" toState="state2">
      <s:AnimateColor duration="1000" target="{myButton}

      " colorPropertyName="baseColor" colorFrom="haloblue" colorTo="red"/>
      </s:Transition>
      <s:Transition fromState="state2" toState="state1">
      <s:AnimateColor duration="1000" target="

      {myButton}

      " colorPropertyName="baseColor" colorFrom="red" colorTo="haloblue"/>
      </s:Transition>
      </s:transitions>-->

      <s:Button id="myButton" width="200" height="200" verticalCenter="0" horizontalCenter="0"
      label="click me"
      baseColor.state1="haloblue" baseColor.state2="red"
      click="clickHandler()"/>

      </s:Application>

      2. click the button to observe the color changes on the Button::baseColor property as it cycles between two states (state1 and state2)

      Actual Results: The baseColor between the haloblue and red is not animated

      Expected Results: the colors should animate

      Workaround (if any): the colorFrom and colorTo properties must be manually set – the animateColor object is unable to pick up the declared color states on the target object (though it picks up the target color properties just fine when colorPropertyName is not need). To see the workaround uncomment/comment code as needed in the code given.

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: