A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Setting Alpha With a Button

  1. #1
    Ok, I have a button within a menu.

    When you rollOver the button I want to change the alpha amount on a movie clip that is on the root timeline

    I have the movie clip that I want to change the alpha on set with instance name AlphaChanger

    Here is the existing code for the button

    on (rollOver) {
    play();
    }
    on (rollOut) {
    gotoAndStop("Start");
    }
    on (release) {
    getURL("page2.html");
    }

    Can you help me fill in the blanks.

    Thanks
    Rick

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Posts
    2,943
    Code:
    on (rollOver) {
    setProperty("_root.alphachanger", _alpha, n)
    play(); 
    }
    Where 'n' is the percentage of the alpha setting.

    You may also need a rollOut button event - not sure how your site is constructed.

  3. #3

    That did the trick!

    That did the trick!

    Thank you Thank you!!!!

    Rick

  4. #4

    Take it to the next level

    Hey just a thought, how might I have it fade to the alpha setting so for example it would slowly fade from 100% to 20%

    I know, never happy but I am learning!

    Thanks
    Rick


  5. #5
    Senior Member
    Join Date
    Jun 2001
    Posts
    2,943
    Easiest way is to set the fading animation in the movie clip, but 'park' it using stop actions.

    Then, on the rollover code:
    Code:
    on (rollOver) {
    _root.alphachanger.gotoAndPlay(n);
    }
    where n is the next frame after the stop action.

  6. #6

    Smile Thanks Again

    That sound good! Thanks again for all the help and the quick reply!!

    Rick

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