Professional Web Applications Themes

animating saturation - Macromedia Flash Actionscript

New to Flash = bear with me I'm trying to create a script that will change an RGB color to 50% grey. In other words, I'd like to move a (R,G,B) value to (128,128,128). I've looked all over, and I cannot find the proper syntax for referring to RGB color values in a way that can be animated. If anyone has any input, it would be much appreciated Thanks ---------------------------...

  1. #1

    Default animating saturation

    New to Flash = bear with me

    I'm trying to create a script that will change an RGB color to 50% grey. In
    other words, I'd like to move a (R,G,B) value to (128,128,128).

    I've looked all over, and I cannot find the proper syntax for referring to
    RGB color values in a way that can be animated. If anyone has any input, it
    would be much appreciated

    Thanks

    ---------------------------

    spdorsey Guest

  2. #2

    Default Re: animating saturation

    You can control tint using actionscript. Put this script on your Actions layer
    and put a movieclip with the instance name "myMovieClip" on the stage. Make
    sure it is not black or there will be no change

    myColor = new Color(myMovieClip)
    myMovieClip.onEnterFrame = function()
    colorDefine = new Object()
    colorDefine.ra = tintIncrease
    colorDefine.ga = tintIncrease
    colorDefine.ba = tintIncrease
    myColor.setTransform(colorDefine)
    tintIncrease += value

    myMovieClip.onRollOver = function()
    if(tintIncrease <= 100)
    value = 10
    }else
    value = 0


    myMovieClip.onRollOut = function()
    if(tintIncrease >= 0)
    value = -10
    }else
    value = 0



    Play around with the numbers until you get the speed and tint you want

    Carixpig Guest

  3. #3

    Default Re: animating saturation


    abeall Guest

  4. #4

    Default Re: animating saturation

    Do you understand about Flash's multiple timeline's? Basically, you can easily
    keep your main movie to have 1 keyframe, but make MovieClip symbols(select an
    object, press F8, select type to be MovieClip) then open it up by double
    clicking. You now have a fresh timeline that is independant from the main
    timeline. Keyframe away, then when you go back to the main movie it's still one
    keyframe. Stick the MC into a button symbol's Over or Up state and that's the
    easy way to get an animated button

    You might already know all that. spdorsey's script will work great, I'm just
    not a hardcore scripter by choice, and would prefer the keyframe method, but if
    it's your style then great

    good luc

    abeall Guest

  5. #5

    Default Re: animating saturation

    There are all sorts of color picker examples and tutes, all of which manipulate
    the color values of a movie clip, including saturation. A good example is at
    [url]http://www.peterjoel.com/Samples/[/url] . Working with colors doesn't require much
    more than knowledge of the Color object, and the ability to use ratios

    Pete Hughes Guest

  6. #6

    Default Re: animating saturation

    I did forget one thing. I converted RGB to a pseudo-HSB. That allowed me to
    work on the saturation directly. I suppose Peter Joel's example does the same
    thing but let me know if you need more information

    Pete Hughes Guest

Similar Threads

  1. Over saturation when printing
    By B._McLaughlin@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 10
    Last Post: June 2nd, 05:21 PM
  2. hue saturation option
    By exingo@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 19
    Last Post: February 24th, 02:40 AM
  3. Images/Hue & Saturation
    By Devon Johnston in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 2
    Last Post: August 7th, 06:09 PM
  4. Saturation/desaturation brush
    By Leen Koper in forum Adobe Photoshop Elements
    Replies: 8
    Last Post: July 22nd, 04:32 PM
  5. Colorize Saturation Slider
    By George Austin in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 63
    Last Post: July 16th, 01:03 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139