Strange happenings using filters
Hi I am trying to return a drop shadow filter on a property of an object by calling a function in another class called, "FilterClass." I have several properties I am trying to add filters to, or not add drop shadow filters to, depending on the Boolean perameter that tells the function in the FilterClass whether or not to add the filter to it. The problem is it is either making all the properties have the dropshadow filter or all of them not have it, regardless of whether the boolean value in the perameter is true or false. Here is the code from the filter class function:
public function dropShadowFilter(dropShad:Boolean):Object{
var _filterObject:Object = new Object();
if(dropShad){
_myShadow.distance = 10;
_myShadow.color = 0x000000;
_myShadow.blurX = 10;
_myShadow.blurY = 10;
_myShadow.quality = 3;
_filterObject.myShadow = _myShadow;
_filterObject.myShadow.alpha = 1;
}else{
_filterObject.myShadow = _myShadow;
_filterObject.myShadow.alpha = 0;
}
trace("_filterObject.myShadow.distance = "+_filterObject.myShadow.distance,dropShad);
return _filterObject.myShadow;
}
and the function that calls the dropShadowFilter function above is the following:
private function dropShadowFilter():void{
_filterObject.myControlsShadow = filterClass.dropShadowFilter(false);
trace("_filterObject.myControlsShadow.alpha = "+_filterObject.myControlsShadow.alpha);
_filterObject.myBackShadow = filterClass.dropShadowFilter(true);
trace("_filterObject.myControlsShadow.alpha = "+_filterObject.myControlsShadow.alpha);
trace("_filterObject.myBackShadow.alpha = "+_filterObject.myBackShadow.alpha);
_filterObject.myAddMoneyShadow = filterClass.dropShadowFilter(true);
_filterObject.myMusicShadow = filterClass.dropShadowFilter(true);
_filterObject.mySoundShadow = filterClass.dropShadowFilter(true);
_filterObject.myWhichLanguageShadow = filterClass.dropShadowFilter(true);
}
the trace statements show what is happening but I can't figure out why unless it's something to do with the filters I don't know about:
currentSystemState=14
_filterObject.myShadow.distance = 0 false
_filterObject.myControlsShadow.alpha = 0
_filterObject.myShadow.distance = 10 true
_filterObject.myControlsShadow.alpha = 1------>this property changes to 1 when I haven't programmed it to do so
_filterObject.myBackShadow.alpha = 1
if anyone knows why this is happening please let me know, thanks