PDA

View Full Version : Movie disappears when using filters


ruz8118
04-15-2011, 03:09 AM
Hi,

I am creating an interactive canvas where a user can click on items (movie clips) in the canvas and the movie zooms in and displays the item.

The problem is when I add filters to these items some of them disappear in a minute or so. :confused:

here is the code:

public function setEffects(){
var BackValue = MovieClip(root).BackZ;
var halfChange = BackValue / 2;
var newBlur = 0
var ch = halfChange / 7;
var glowAlpha = 0;

if(MovieClip(root).singleton && !focusMe){
newBlur = 7;
glowAlpha = 0.8;
} else if(halfChange < this.z){
newBlur = Math.round((this.z - halfChange) / ch);
glowAlpha = 0.6;
} else {
newBlur = 0
}

autoUpdateEffects++;

if(autoUpdateEffects >= 50){
autoUpdateEffects = 0;

if(effectsMovement){
this.z++;
} else {
this.z--;
}
//trace("Updated effects: " + itemLocation.number + " " + itemLocation.array);

effectsMovement = !effectsMovement;
}

if(newBlur != blurEffect){
blurEffect = newBlur;

autoUpdateEffects = 0;

if(blurEffect != 0){
blur = new BlurFilter();
blur.blurX = newBlur;
blur.blurY = newBlur;
blur.quality = BitmapFilterQuality.LOW;

myGlowFilter = new GlowFilter;
myGlowFilter.color = 0xBA0A00;
myGlowFilter.alpha = glowAlpha;
myGlowFilter.blurX = 255;
myGlowFilter.blurY = 255;
myGlowFilter.inner = true;
myGlowFilter.quality = BitmapFilterQuality.LOW;

this.filters = [blur, myGlowFilter];

} else {
this.filters = [];
}
}
}

this is called on enter frame.

Does anyone have any ideas?

xshanky
04-15-2011, 06:24 AM
Friend can you attach your fla (if not too confidential). It will make things much clearer.