Freezing while emitting or playing sound

Working on a music app that plays when recs are touched by circles and an emitter is called. The emitter doesn't work on more than two recs and the sound also has some issues. ZIM Editor - JavaScript Canvas Online Code Editor and Viewer


@mathtechie - the link does not seem to have any code in it. Can you save and let us know.

It sounds like it is because you are playing sounds and emitting on a hitTest in a Ticker or pressmove event and the hitTest is happening quite a lot. So check the Tips on hitTests here: and note the part half way down about Hitting Too Many Times.

Yes, it's a press move. I will try this tomorrow. Thanks for the reply.

1 Like

OK, that seemed to have fixed the playing issue but the emitter is still only launching on two rects. The synth is a bit lagging too.

1 Like

Do a zog() to find out if the hitTest is going when the emitter is not going. See where the problem is. Works pretty good for me - the emitter is off to the left so you want to reg(CENTER) all your objects including the emitter and perhaps set your emitter width to 1.