Flint Particle System Forum - EmitterEvent.COUNTER_COMPLETE randomly fails Mon, 09 May 2016 00:15:14 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher EmitterEvent.COUNTER_COMPLETE randomly fails http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1235#Comment_1235 http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1235#Comment_1235 Sun, 20 Jun 2010 01:18:37 +0100 BrokenBulb
code in cs5:


particleRenderer = addChild(new DisplayObjectRenderer());
particleRenderer.x = circImg.x - circImg.width / 2;
particleRenderer.y = circImg.y - circImg.height / 2;
var emitter:Emitter2D = new Emitter2D();
particleRenderer.addEmitter(emitter);
emitter.counter = new TimePeriod(300, 2);
emitter.addInitializer(new ImageClasses([[RadialDot, 5, 0x0000ff],[RadialDot, 4, 0x0000ff],[RadialDot, 3, 0x0000ff],[RadialDot, 2, 0x0000ff]]));
emitter.addInitializer(new Position(new BitmapDataZone(new MagicCircleImg(1, 1))));
emitter.addInitializer(new Velocity(new LineZone(new Point(0, -100), new Point(0, -150))));
emitter.addInitializer(new Lifetime(1, 2));
emitter.addAction(new Age(Linear.easeIn));
emitter.addAction(new Fade(1, 0));
emitter.addAction(new Move());
emitter.addEventListener(EmitterEvent.COUNTER_COMPLETE, removeEffect);
emitter.start(); ]]>
EmitterEvent.COUNTER_COMPLETE randomly fails http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1236#Comment_1236 http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1236#Comment_1236 Sun, 20 Jun 2010 21:17:17 +0100 Richard
I tested your code in Flash CS4. I ran it thirty times and the COUNTER_COMPLETE event fired every time. Are you certain the error isn't in your event handler? I put a trace in the removeEffect method to confirm that it was running each time. ]]>
EmitterEvent.COUNTER_COMPLETE randomly fails http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1237#Comment_1237 http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1237#Comment_1237 Sun, 20 Jun 2010 22:48:00 +0100 BrokenBulb
Yeah, i'm not sure what's going on. I also used a trace in the handler and it traces almost every time. but every once in a while it fails. Sometimes it failed withing the first few runs, sometimes I had to run it many times, but it always fails at some point.

I'm not sure how to help you reproduce it other than to say keep trying :) sorry. ]]>
EmitterEvent.COUNTER_COMPLETE randomly fails http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1238#Comment_1238 http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1238#Comment_1238 Mon, 21 Jun 2010 20:57:45 +0100 Richard