Ah - that is because AnimateProperty is just cycling through all the RGB
values between your fromValue color and your endValue color. What you
may want to do is add an event handler for the tweenUpdate event on the
AnimateProperty effect instance and check to see what the value passed
in the TweenEvent object is. That value is what the backgroundColor is
at that moment in the lifetime of the effect. You can then add in your
own logic that sets the backgroundColor depending on where the effect is
in its lifetime (ie: simulate a progression from dark gray to light
gray). I'm not 100% sure how that will work out but I'd be interested in
finding out what doesn't work about it.

 

Incidentally, you should check out Alex Uhlmann's Animation Package
where I think he has an effect that does exactly what you want. That
will probably be easier :-) 

http://www.alex-uhlmann.de/flash/animationpackage/

 

-deepa

 

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of dorkie dork from dorktown
Sent: Monday, December 04, 2006 2:31 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Fade from one color to another

 

i see. that mostly works. except now it cycles through every color
giving a flicker effect like i am on acid. try this to see:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " layout="absolute"
styleName="plain"
    creationCompleteEffect="{fadeColor}">
    <mx:AnimateProperty id="fadeColor" isStyle="true"
property="backgroundColor" 
        fromValue="0xFFFFFF" toValue="0x000000"
target="{Application.application}" 
        duration="2000"/>
</mx:Application>

If i change the fromValue and the toValue to a two digit number like so
it is a very smooth transition but it does not fade from white.  It only
fades from blue. Try this: 

    <mx:AnimateProperty id="fadeColor" isStyle="true"
property="backgroundColor" 
        fromValue="0xFF" toValue="0x00"
target="{Application.application}" 
        duration="2000"/>

I am thinking of just transitioning to a blank black state but that
feels like a hack. 

dorkie best practices dork from dorktown

On 12/4/06, Deepa Subramaniam <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

Set the the isStyle property to true in your AnimateProperty tag. 

 

-deepa

 

________________________________

From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of dorkie dork from dorktown
Sent: Monday, December 04, 2006 5:25 AM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] Fade from one color to another

 

I need to fade my application background color from 0xC47D31 to 0x67DEF9
and I have no idea where to start. I've seen AS2 actionscript around
that I can try to convert but what I'm looking for is a already built
MXML component Effect, similar to mx:Fade or Dissolve. 

I tried this and received errors:
    creationCompleteEffect="{fadeColor}">
    <mx:AnimateProperty id="fadeColor" property="backgroundColor"
toValue="#000000" target="{Application.application}" duration="5000"/> 

ReferenceError: Error #1069: Property backgroundColor not found on
TestApplication and there is no default value.
    at
mx.effects.effectClasses::AnimatePropertyInstance/::getCurrentValue()

dorkie mood changing dork from dorktown 



 

 

Reply via email to