Hide AS3 animated snow during animation?
Hello. I am creating an animation in Animate CC that includes some snow created using ActionScript 3 on a layer above a background. I would like to be able to hide the snow for a little bit during the animation and then have it come back later. I thought having a movie clip animation with a solid background fade in on a layer above the snow would do this for me, but it seems the snow action script layer stays on top of all layers no matter what. At least how I am doing it. Is there any way to control this? I tried putting a mask layer on the snow AS3 layer and changing the opacity, but that didn't work. I also tried placing the snow AS3 layer inside a movie clip layer and fading that out and back in again and this did not work either. Any help as soon as I can get it would be great as I'm trying to get this animation/movie out soon for the holidays.
Btw, in case it can help, here's the code I used for the snow:
addEventListener (Event.ENTER_FRAME,snow);
function snow (event:Event):void {
var scale:Number=Math.random()*.6;
var _sf:snowflake2=new snowflake2();
_sf.x=Math.random()*900;
_sf.scaleX=scale;
_sf.scaleY=scale;
var speed:Number=Math.random()*3;
var RA:Array=new Array(-1,0);
var lf:int=RA[Math.round(Math.random())];
stage.addChild (_sf);
_sf.addEventListener (Event.ENTER_FRAME,snowfall);
function snowfall (event:Event):void {
_sf.y+=speed;
_sf.rotation+=Math.random()*10;
_sf.x+=(Math.random()*1)*lf;
}
}
