title: actionscript3. enter_frame event on certain frames?
body: <p>I have only just started to learn a bit of actionscript/javascript.
  I'm trying to apply a glow and blur filter to an instance of a sun. (I realise I could do this without actionscript, but the project requires some use of as3) Problem is the sun does not appear in every frame. Can an enter_frame event still be used?
  Is there a much more simple way I could do this?</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>import flash.filters.GlowFilter;
  import flash.filters.BlurFilter;
  import flash.events.Event;
  
  var sunglow:GlowFilter= new GlowFilter(0xffff00,0.8);
  var sunblur:BlurFilter= new BlurFilter();
  var f:int = 0;
  
  addEventListener(Event.ENTER_FRAME,fl_EnterFrameHandler);
  function fl_EnterFrameHandler(event:Event):void{
  if (f &gt; 29 &amp;&amp; f &lt; 350) { 
  var random1 = Math.random()*2+40;
  var random2 = Math.random()*2+8;
  sunglow.blurX = random1;
  sunglow.blurY = random1;
  sunblur.blurX = random2;
  sunblur.blurY = random2;
  sunshine.filters = [sunglow,sunblur];
  }
  f++;
  }
  </code></pre>
  
  <p>Cheers</p>