Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting Flash Perlin Function From ActionScript 1 to 3
    primarykey
    data
    text
    <p>I have some code for Flash to simulate moving clouds. It worked under AS1 and now I have updated the FLA file to AS3 and minimum Flash version 10. What is wrong with this code? Can you help see what is wrong with this function? </p> <pre><code>function createLiquidFlow(target) { target.counter = 1; target.pt = new flash.geom.Point(0, 0); target.mpoint = new flash.geom.Point(0, 0); // target.myBitmap = new flash.display.BitmapData(target._width, target._height, false, 0); target.myBitmap = new flash.display.BitmapData(target.width, target.height, false, 0 ); target.myDispl = new flash.filters.DisplacementMapFilter(target.myBitmap, target.mpoint, 10, 2, 10, 15, "clamp"); target.myList = new Array(); target.myList.push(target.myDispl); target.filters = target.myList; target.addEventListener(Event.ENTER_FRAME, function () { trace("target.name = "+target.name); trace("target.myBitmap = "+target.myBitmap); trace("target.myBitmap.width = "+target.myBitmap.width); trace("target.myBitmap.height = "+target.myBitmap.height); trace("target.counter = "+target.counter); var filterList = target.filters; var offset = new Array(); offset[1] = new Object(); offset[1].x = target.counter; offset[1].y = target.counter / 2; target.myBitmap.perlinNoise(45, 6, 3, 50, true, false, 7, true, offset); filterList.mapBitmap = target.myBitmap; target.filters = filterList; ++target.counter; }); } createLiquidFlow( movieClipLiquid ) </code></pre> <p>I can trace the event listener, but the bitmap and Perlin function appears not to work. There is nothing visually happening in the output SWF. TIA</p> <pre><code>target.name = liquid74_mc target.myBitmap = [object BitmapData] target.myBitmap.width = 950 target.myBitmap.height = 76 target.counter = 1 myFilterList = [object DisplacementMapFilter] BEFORE myFilterList.mapBitmap = undefined AFTER myFilterList.mapBitmap = [object BitmapData] BEFORE target.filters = [object DisplacementMapFilter] AFTER target.filters = [object DisplacementMapFilter] target.name = liquid74_mc target.myBitmap = [object BitmapData] target.myBitmap.width = 950 target.myBitmap.height = 76 target.counter = 2 myFilterList = [object DisplacementMapFilter] BEFORE myFilterList.mapBitmap = undefined AFTER myFilterList.mapBitmap = [object BitmapData] BEFORE target.filters = [object DisplacementMapFilter] AFTER target.filters = [object DisplacementMapFilter] </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload