A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Changing alpha with push of a button

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    11
    here's a story of a movie with a button that when pushed, it needs to get another button to change its alpha to zero. i.e. when a button is pushed, it makes other buttons phase out. any idea how? tried using instances by changing the buttons to movies, but it seems like there would be an easier way.
    HELP!!!

    thanks in advance for the replies!

    - nick

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Posts
    2,943
    The movie way is a good one - you can change alpha on movies and keep functionality inside them.

    Another way is to create a square (turn it into a clip) with the same colour as the back ground, place it over the button(s) (use a separate layer above the button layer), and set the alpha of that (use tweening) so that the buttons show through to varying degrees. You could combine this with a mask if you need to.

  3. #3
    Stick In The Mud
    Join Date
    Oct 2000
    Posts
    752
    Hi There,
    add this to the MC you want to fade (eg. bob)..

    Code:
    onClipEvent(load){
    doFade = false;
    _alpha = 100;
    fadeRate = 5;
    }
    
    onClipEvent(enterFrame){
    if (doFade){
    _alpha-=fadeRate;
    if (_alpha<0){
    _alpha = 0;
    doFade = false;
    }
    }
    }
    then to make the MC fade all you have to do is:

    Code:
    //remember to target the MC bob properly
    on(release){
    bob.doFade=true;
    }
    hope this helps,
    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center