actionscript dilemma

  • roje0913
  • Student
  • Student
  • roje0913
  • Posts: 78

Post 3+ Months Ago

I am having a problem getting this to continue without stopping. At first it will appear that it does but after 4-5 minutes it will stop and I cannot figure out why. You can see the source file here (fla download is under the flash):
http://www.senocular.com/flash/source.php?id=0.188

the actionscript is in first frame, if anyone can figure out why this is no looping properly or has a solution please let me know!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • roje0913
  • Student
  • Student
  • roje0913
  • Posts: 78

Post 3+ Months Ago

I found it! I added the following line of code:
if (shift.tx >= 3000) shift.tx = 0;

here is the full actionscript (with the new line of code )if someone is so inclined to use it :

Stage.scaleMode = "noScale";
displace_mc.createEmptyMovieClip("perlin", 1);
var ramp = displace_mc.ramp;
ramp.swapDepths(2);
var speed = 4;
var channel = 1;
var flapX = 50;
var flapY = 50;
var mode = "clamp";
var offset = new flash.geom.Point(0, 1);
var displaceBitmap = new flash.display.BitmapData(ramp._width, ramp._height);
var displaceFilter = new flash.filters.DisplacementMapFilter(displaceBitmap, offset, channel, channel, flapX, flapY, mode);
var baseX = 80;
var baseY = 0;
var octs = 1;
var seed = Math.floor(Math.random() * 50);
var stitch = true;
var fractal = true;
var gray = false;
var noiseBitmap = new flash.display.BitmapData(768, 1);
noiseBitmap.perlinNoise(baseX, baseY, octs, seed, stitch, fractal, channel, gray);
var shift = new flash.geom.Matrix();

onEnterFrame = function ()
{
shift.translate(speed, 0);
if (shift.tx >= 3000) shift.tx = 0;
with (displace_mc.perlin)
{
clear();
beginBitmapFill(noiseBitmap, shift);
moveTo(0, 0);
lineTo(ramp._width, 0);
lineTo(ramp._width, ramp._height);
lineTo(0, ramp._height);
lineTo(0, 0);
endFill();
} // End of with
displaceBitmap.draw(displace_mc);
flag_mc.filters = [displaceFilter];
};

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 26 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.