PDA

View Full Version : Random Glow



JoshuaR
June 7th, 2007, 03:42 AM
Hi guys,
I'm making a website and I need some help with the effects (I'm kind of new to this--which you'll see pretty quickly :P ). I am planning on having some circles (it's hard to explain, but they're art) on the site, and I'm looking for an effect that will randomly make individual circles glow. I thought about putting the circles in movie clips with corresponding glow effects in separate movie clips behind them, and then having a script call the glow clips in randomly. But the only tutorials I could find call the movie clips in on load, and I want it to happen while the page is being viewed, and not just each time the page is visited. I don't know if this is a really bad idea/way of doing it, but if anyone has any ideas or suggestions I'd really appreciate it :).

Thanks

sasxa
June 7th, 2007, 05:24 AM
you could try something like this:


var timer:Timer = new Timer(10000);
timer.addEventListener(Event.TIMER_COMPLETE, glow);

private function glow(event:TimerEvent):void {
var n:Number = Math.round(Math.random()*10))
//assuming you have 10 circles...
getChildByName("circle"+n).filters = [new GlowFilter()];
//that are called 'circle1', 'circle2' etc.
}
also, you could make another timer and animate glow by changing GlowFilter() settings on Event.TIMER. check help for more options for filters (and/or timers) :) ...

JoshuaR
June 7th, 2007, 08:02 AM
hey thanks saxsa, I'll have a try with that and see how it goes.
Cheers :thumb: