Movies as buttons...use actionscript for behavior

Hey gang,

I’ve been experimenting with a new way to lay out a bunch of buttons on page. Basically, I set up function on frame 1 and then assign all button behaviours to frame 1 too. This has made it easy to edit the behaviours of many buttons easily. I use movies so I dont bother wasting time with the individual button states that one might otherwise use. Instead, I use Actionscript for all button states, as you can see in the code below.

Now for my question. On rollover, I want the button color to “flicker” or “fluctuate”. Ideally, it would flicker quickly between alpha states of about 20%-70% very quickly.

I made the code below, which was initially set up to “flicker” with random colors on rollover state…but it isnt working. Any ideas as to what actionscript would cause my buttonMovie to “flicker” within a given alpha range of its current color?

<–the code is below that I have started but the rollover actionscript is not quite right–>

// function to handle the rolling over any button which should produce random color effect but will not fluctuate rapidly
function rolledOver(){
//this interval set is optional and may not
ranRed = Math.random()*256;
ranGreen = Math.random()*256;
ranBlue = Math.random()*256;
curveColor = ranRed << 16 | ranGreen << 8 | ranBlue;
curveAlpha = Math.random()*25+25;

// function to handle the rolling out of any button
function rolledOut(){
this._alpha = 100;

// function to handle the press of any button
function pressed(){
this._alpha = 20;

// function to handle the mouse release of any button
function released(){
this.alpha = 100;

// attach above functions to Button1
Button1.onRollOver = rolledOver;
Button1.onRollOut = rolledOut;
Button1.onPress = pressed;
Button1onRelease = released;

// attach above functions to Button2
Button2.onRollOver = rolledOver;
Button2.onRollOut = rolledOut;
Button2.onPress = pressed;
Button2onRelease = released;

// attach above functions to Button3
Button3.onRollOver = rolledOver;
Button3.onRollOut = rolledOut;
Button3.onPress = pressed;
Button3.onRelease = released;