Skip navigation
Currently Being Moderated

Running Perlin Noise concurrently with other EventListeners

Jun 20, 2012 6:05 PM

Tags: #as3 #clicktag #flash_cs6 #perlin_noise #pencil_pushdown

I'm trying to create a pencil pushdown ad that utilizes Perlin Noise for flames and also utilizes two other event listeners - one for a clickTAG and another that will display a different ad on mouse out.  The perlin noise will run fine, but this disables my code for the clickTAG and the mouse out event (which work just fine in my other ads without perlin noise). The following is just the portion of the code that I think is effected.  Any thoughts?


// Perlin Noise

addEventListener(Event.ENTER_FRAME, animate);

function animate(e:Event):void {

          // Animating the octaves in time

          for(var o=0;o<numOctaves;o++){

                    offsets[o].x += speeds[o].x;

                    offsets[o].y += speeds[o].y;


          bitmapData.perlinNoise(baseX, baseY, numOctaves, randomSeed, stitch, fractalNoise, channelOptions, grayScale, offsets);

          Flames.filters = [disp];



// clickTAG

Button.addEventListener(MouseEvent.CLICK, goToClickTag, false, 0, true);


function goToClickTag(e:MouseEvent):void{

var url:String = this.loaderInfo.parameters.clickTAG;

var request:URLRequest = new URLRequest(url);

try {

navigateToURL(request, '_blank');

} catch (e:Error) {

trace("Error occurred!");




// Close Ad

Button.addEventListener(MouseEvent.MOUSE_OUT, MoveOut, false, 0, true);


function MoveOut(e:MouseEvent):void {

          var url:String = "javascript:closeAd();";

          var mouseoutrequest:URLRequest = new URLRequest(url);

          navigateToURL(mouseoutrequest, "_self");



More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points