Connecting Tech Pros Worldwide Help | Site Map

Flash ActionScript - Filters

Newbie
 
Join Date: Oct 2008
Posts: 2
#1: Oct 14 '08
Hi,
I'm trying to control the brightness of an image through action script that would be in turn controlled by buttons.

So, on the on(release) handler How would I attach a code that would make it brighter or darker, hopefully by controlling the color - brightness filter? via actionscript

thanks,

JZ
joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#2: Oct 14 '08

re: Flash ActionScript - Filters


Well, a Bitmap or Graphic doesn't have the Filters enabled for them. Also, Please don't double post, it is against the Posting Guidelines.

joedeene
joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#3: Oct 28 '08

re: Flash ActionScript - Filters


Although, if you changed it into a movie clip, you could use the MovieClip._alpha Property, and so an example of an on(event) handler would be one like this...

Expand|Select|Wrap|Line Numbers
  1. on (release) {
  2.     _root.image_mc._alpha = 100;
  3. }
  4.  
joedeene
Newbie
 
Join Date: Oct 2008
Location: Earth
Posts: 29
#4: Nov 1 '08

re: Flash ActionScript - Filters


You will need to create variables to hold the filter information, then push the dynamic filter into the filter array for your object. However a bitmap cannot have filters applied to it so you would need to place it inside a movie clip. You could also use the ._alpha variable to control the brightness as an alternative to filters.
Reply