Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Fade In Button

I'm trying to get a button image to fade in at a certain point. I want something like this, but I'm not sure how to accomplish it…

var openWin2Button = Titanium.UI.createButton({
    backgroundImage:'pages/img/social_b_off.png',
    backgroundSelectedImage:'pages/img/social_b_on.png',
    height:34,
    width:82,
    top:292,
    right:133

  });

var buttonAnimation = Titanium.UI.createAnimation({
        curve:Ti.UI.ANIMATION_CURVE_EASE_IN,
        opacity:1,
        duration:2000
    });

win.add(openWin2Button)
— asked August 17th 2010 by Mark Smillie
  • easein
  • fade
0 Comments

1 Answer

  • try this ( untested )

    
    var openWin2Button = Titanium.UI.createButton({
        backgroundImage:'pages/img/social_b_off.png',
        backgroundSelectedImage:'pages/img/social_b_on.png',
        height:34,
        width:82,
        top:292,
        right:133,
    
    
    opacity:0
    
      });
    
    var buttonAnimation = Titanium.UI.createAnimation({
            curve:Ti.UI.ANIMATION_CURVE_EASE_IN,
            opacity:1,
            duration:2000
        });
    
    win.add(openWin2Button);
    
    openWin2Button.animate( buttonAnimation );
    
    — answered August 17th 2010 by Dan Tamas
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.