A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Adjust Brightness on rollover...?

  1. #1
    reMember
    Join Date
    Oct 2002
    Location
    Hull, UK
    Posts
    87

    Adjust Brightness on rollover...?

    Hi Guys,
    Is it possible to adjust the brightness property of a button using scripting rather than using a movieclip and telling the movieclip to play on rollover etc.
    I've posted an example of what I mean.
    Pdue
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Aug 2003
    Location
    .. keep movin' ...
    Posts
    137
    nope .. as far as i know u can't control Brightness through A.S. .. however, Alpha can be controled, but not Brightness.
    Theres a Devil inside us all .. only, some are afraid to bring it out !

  3. #3
    reMember
    Join Date
    Oct 2002
    Location
    Hull, UK
    Posts
    87

    so....

    Oh right, how do you change the alpha gradually then??
    to make it so normally the button is at 50% then when you rollover it, gradually it gets up to 100% and stops. When you rollout it gradually goes back down to 50%. ????

  4. #4
    Senior Member
    Join Date
    Aug 2003
    Location
    .. keep movin' ...
    Posts
    137
    whoooooooooops ..
    ............. did i mention something about graduality .. no i didn't ..
    .. the best way to achieve the kinda effect u want, is to use movie clips ... either use movie clips as buttons, or insert a movie clip in the buttons Over state ... make the alpha changes using Tween .. and it would rock !
    Theres a Devil inside us all .. only, some are afraid to bring it out !

  5. #5
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    You could do it via AS:
    code:

    on (rollOver) {
    _root.onEnterFrame = function() {
    _root.clip._alpha += 5;
    if (_root.clip._alpha == 100) {
    _root.clip._alpha = 100;
    }
    };
    }
    //on rollOut:
    on (rollOut) {
    _root.onEnterFrame = function() {
    _root.clip._alpha -= 8;
    if (_root.clip._alpha<=50) {
    _root.clip._alpha = 50;
    }
    };
    }


    Change "clip" to the name of your MC.

    -edit-

    Now that I look at this and your problem, you could change "_root.clip" with "this". Haven't tried it. Also, try replacing the "_root.clip._alpha = 50;" with "delete this.onEnterFrame". Just a thought...
    Last edited by Steve_w_V; 11-27-2003 at 04:26 PM.
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

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