Please help with this error

Hi,
I am using Flash 8’s actionscript. I am making an application where when you select a colour from my colour selector it will make a glow effect. However when I do this, this happens:
Error Scene=Scene 1, layer=actions, frame=1:Line 8: Type mismatch.
new GlowFilter(t1.setRGB(eventObj.newColor),100,“glowx”,“glowy”,100,100,false,false)
Total ActionScript Errors: 1 Reported Errors: 1

My 1st question:
What is a “Type Mismatch”?

My 2nd question:
How do I fix the error?

Thanks

A type mismatch means that Flash is expecting a different datatype to the one that’s provided. In your case,
blurX and blurY should be numbers…you’ve assigned the string values “glowx” and "glowy"
Try changing it to:
new GlowFilter(t1.setRGB(eventObj.newColor), 100, glowx, glowy, 100, 100, false, false);

This assumes that you have two variables, glowx and glowy, which contain numbers in the range 0 - 255.

I have a numeric stepper component that has a max value of 10 and a min value of 0. Shall I still do it as you said too?

EDIT:
That works but I have two boxes. One for text colour and one for glow colour. The glow colour needs to be the same as the second one (mc2). How would I go about doing this?

As soon as I acquire clairvoyant skills, and can second-guess what your code is without seeing it, you’ll be among the first to know.

Until that unlikely event occurs, try experimenting with:
var my_color:Color = new Color(mc2);
my_color.setRGB(eventObj.newColor);

What do you mean by “Until that unlikely event occurs”?

What I need to happen is:

  1. You type the text into the input box. (done)
  2. You select your two colours (using a colour selector). (done)
  3. When you do number 2, the 2nd colour that you pick is the glow colour. Then the “pre-made” glow will change it’s colour to the 2nd colour you pick. It needs to get the RGB value of the 2nd colour preview box. Then it will change the glow colour. (need help)
  4. I have two numeric steppers. One of them is for Blur X and one for Blur Y. When you change either of them, it will change the Blur X and Y of the text glow. (need help)

Thanks

I mean precisely what I said…I’m not going to attempt to guess what code you’re using. You’ll need to attach your fla to get any kind of meaningful response to what appears to be a complex request.

From the vague code you’ve already posted, I (and everyone else who’s looked at this question) would’ve assumed that your colour selection was captured by eventObj.newColor and stored as a property of t1. But that is just a wild guess and it now appears that you have two separate colour preview boxes. I could jump to the conclusion that you’ve named the second colour selector t2 but again, that is just a guess…who knows, apart from you?

As for the numeric steppers, you would have to use some kind of tween, loop, setinterval, or enterframe event to update the blurX and blurY values…otherwise they will remain static values. Of course, I could just be guessing there too because I don’t have the foggiest idea how your code is structured.

Telling us what you need to happen is one thing…but expecting anyone to tell you how to go about it - without any clues in the form of code - is something else entirely.

Ok, here is the flash file. All the stuff (actions etc) is on the layer named “actions”.
http://trexgamer.googlepages.com/helpflash.fla

You will need the colour picker component to open this. It can be got here:
http://www.flashcomponents.net/component/color_picker_component.html

glosrfc: have you got any more advice? There is the fla file above.

No, not really. I’d suggest looking at this resource:
http://www.oman3d.com/tutorials/flash/filters_as_bc/

Note the references to how, once you’ve created your new glowfilter, it’s stored into an array and you have to edit a copy of this array in order to make any changes to its properties.