A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Set brightness on MC

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Location
    Copenhagen
    Posts
    228

    Set brightness on MC

    Here's a quick one:

    What is the easiest way to change brightness on a MC. I know that I'll need the Color class, but can't seem to get it to work.

    Thanks

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    This is selfexplanatory:
    PHP Code:
    import flash.filters.ColorMatrixFilter;
    var 
    _bright=0.5;
    var 
    myElements_array:Array = [10001,
                
    01001,
                
    00101,
                
    000_bright0];
    var 
    myColorMatrix_filter:ColorMatrixFilter = new ColorMatrixFilter(myElements_array);
    target_mc.filters = [myColorMatrix_filter]; 
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Oct 2002
    Location
    Copenhagen
    Posts
    228
    Thanks. That did it!

  4. #4
    Senior Member
    Join Date
    Nov 2003
    Location
    Las Vegas
    Posts
    770
    I'm not certain it makes a huge difference, but there is a somewhat more complex method used in Grant Skinner's ColorMatrix class. And the hue, contrast, and saturation methods are great.

  5. #5
    Junior Member
    Join Date
    Jun 2008
    Posts
    6
    It's just alpha not brightness.

    how can i change brightness?

  6. #6
    Senior Member
    Join Date
    Nov 2003
    Location
    Las Vegas
    Posts
    770
    The same class I posted also controls brightness, see the example and download the source from gskinner.com:gBlog

    ColorMatrix Class in AS3
    Flash 8 Source - Color Matrix

  7. #7
    Senior Member
    Join Date
    Oct 2002
    Location
    Copenhagen
    Posts
    228
    Thanks! I'll have a look at it.

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