Skip to main content
Participating Frequently
April 25, 2006
Answered

How To Get That Elusive Yellow Glow?

  • April 25, 2006
  • 5 replies
  • 454 views
I want to make a short animated logo in which part of the logo has a pulsating glow whilst a melodramatic sound plays in the background. I took the following code from the helpfile and tweeked it. What I'd like is a pulsating yellow glow... but all I get is some error I can't fix;


[code]
box_mc.filters = [new flash.filters.GlowFilter(color:0xF0F727)];
var dir:Number = 2;
box_mc.blur = 10;
box_mc.onEnterFrame = function() {
box_mc.blur += dir;
if ((box_mc.blur >= 30) || (box_mc.blur <= 10)) {
dir *= -1;
}
var filter_array:Array = box_mc.filters;
filter_array[0].blurX = box_mc.blur;
filter_array[0].blurY = box_mc.blur;
box_mc.filters = filter_array;
};
[/code]

Error:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: ')' or ',' expected
box_mc.filters = [new flash.filters.GlowFilter(color:0xF0F727)];

Total ActionScript Errors: 1 Reported Errors: 1


You know, if yellow was the default glow colour, I wouldn't have this problem...
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Craig Grummitt
Just take the word "color:" out of the filter declaration and you should be right:

box_mc.filters = [new flash.filters.GlowFilter(0xF0F727)];

5 replies

Craig Grummitt
Craig GrummittCorrect answer
Inspiring
April 26, 2006
Just take the word "color:" out of the filter declaration and you should be right:

box_mc.filters = [new flash.filters.GlowFilter(0xF0F727)];
Participating Frequently
April 26, 2006
You've solved it! Thanks!
Inspiring
April 25, 2006
Looks like you didn't take enough of the code... This should fix your
problem:


import flash.filters.BlurFilter;
var filter:BlurFilter = new BlurFilter (10, 10, 3);
box_mc.filters = new Array (filter);
//
var dir:Number = 2;
//
box_mc.onEnterFrame = function () {
var myBlur:BlurFilter = this.filters[0];
myBlur.blurX += dir;
myBlur.blurY += dir;
if ((myBlur.blurX >= 30) || (myBlur.blurX <= 10)) {
dir *= -1;
}
this.filters = new Array (myBlur);
};
//
stop ();


--
Dave -
Adobe Community Expert
www.blurredistinction.com
www.macromedia.com/support/forums/team_macromedia/


Participating Frequently
April 26, 2006
Sorry, I'm not sure what you're suggesting. I tried using your code, but the logo blurred. What I'd like is a yellow glow to pulsate around/behind the logo but all I can get is black (or red if I don't specify a colour).
Participating Frequently
April 25, 2006
I tried box_mc.filters = [new flash.filters.GlowFilter(color(0xF0F727))];

but then the glow just turned black