# Make a filter value random

**URL:** <https://forum.kirupa.com/t/make-a-filter-value-random/199465>\
**Category:** flash\
**Created:** [September 2, 2006, 7:22pm UTC](https://forum.kirupa.com/t/make-a-filter-value-random/199465 "2006-09-02T19:22:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanontheMoon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danonthemoon/32/7436_2.png) [@DanontheMoon](https://forum.kirupa.com/u/DanontheMoon)\
**Post date:** [September 2, 2006, 7:22pm UTC](https://forum.kirupa.com/t/make-a-filter-value-random/199465/1 "2006-09-02T19:22:18Z")

</div>

Namely, how do I do it? What I’m trying to do is make a simple SWF with a  
movie clip with a 100% to 0% alpha gradiented white circle with a GradientBevelFilter on it, and I want the angle value to be randomized - I think I could pull off a neat effect with it. Here’s the script I have so far (modified from one of TheCanadian’s tutorials on animating filters)

onClipEvent (enterFrame) {  
import flash.filters.GradientBevelFilter;  
var gb:GradientBevelFilter = new GradientBevelFilter();  
this.filters = [gb];  
this.onRollOver = function() {  
this.onEnterFrame = function() {  
if (gb.angle\<20) {  
gb.angle++;  
} else {  
delete this.onEnterFrame;  
}  
this.filters = [gb];  
};  
};  
this.onRollOut = function() {  
this.onEnterFrame = function() {  
this.filters = [gb];  
if (gb.angle\>3) {  
gb.angle–;  
} else {  
delete this.onEnterFrame;  
}  
};  
};  
}

I’m going to keep messing with it, but if anyone has any suggestions, please chime in! -Dan
