Flint Particle System Forum - EmitterEvent.COUNTER_COMPLETE randomly fails 2016-05-09T05:15:21+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher EmitterEvent.COUNTER_COMPLETE randomly fails http://flintparticles.org/forum/comments.php?DiscussionID=366&Focus=1235#Comment_1235 2010-06-20T01:18:37+01:00 2016-05-09T05:15:21+01:00 BrokenBulb http://flintparticles.org/forum/account.php?u=378 I'm using EmitterEvent.COUNTER_COMPLETE to track the end of emission of a short particle effect, but it doesn't seem to fire every time. code in cs5: particleRenderer = addChild(new ...
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 2010-06-20T21:17:17+01:00 2016-05-09T05:15:21+01:00 Richard http://flintparticles.org/forum/account.php?u=1 Hi 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 ...
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 2010-06-20T22:48:00+01:00 2016-05-09T05:15:21+01:00 BrokenBulb http://flintparticles.org/forum/account.php?u=378 Hi Richard, thanks for replying. 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 ...
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 2010-06-21T20:57:45+01:00 2016-05-09T05:15:21+01:00 Richard http://flintparticles.org/forum/account.php?u=1 I found the problem and have checked the fix into SVN.