-
1. Re: touch event singleton
Mark.Raykhenberg Feb 6, 2012 2:49 PM (in response to igregurec)Try removing your events from stage instead of from this.board. so..
stage.removeEventListener(TouchEvent.TOUCH_MOVE, onTouchMove);
stage.removeEventListener(TouchEvent.TOUCH_END, onTouchEnd);
I also would suggest tracing your events so you know if they are firing or not, maybe with some visual element like a color change or a text box since you cant test touch events directly in flash.
Another edit, I noticed you never remove your touch_begin events, of course they stay there forever, remove them on touch_end.
-
2. Re: touch event singleton
igregurec Feb 6, 2012 2:53 PM (in response to Mark.Raykhenberg)in that case i'll have to add them to the stage first but I don't want the whole stage to be touchable, at least not producing sound.
-
3. Re: touch event singleton
Mark.Raykhenberg Feb 6, 2012 2:58 PM (in response to igregurec)I could be wrong but in my experience adding an event to an object and then removing it from stage does exactly what you would want it to do, seems like stage supercedes everything, since your object is a child of the stage removing it from stage also removes it from your object even if your touch end event fires somewhere off the object. I too am working on a sound board and this solves the issue of touching a button then sliding your finger off the screen and releasing outside if the remove event is tied to the initial touch object it never fires since the touch_end event fired off the object. See my other edits in my first reply.
-
4. Re: touch event singleton
igregurec Feb 6, 2012 3:11 PM (in response to Mark.Raykhenberg)thank you, I'll try that.
I was also thinking about creating only 4 (there can't be more) objects that represent touch and then swithcing their visibility instead of adding and removing Children.
how far did you come with your soundboard?
-
5. Re: touch event singleton
Mark.Raykhenberg Feb 6, 2012 3:15 PM (in response to igregurec)My soundboard seems to work well except when there is a lot of sounds going on at once it seems to slow down the device and it becomes a big laggy noise, I sm using high quality, 10-20 sec stereo mp3s. It still has a lot of work that needs to be done to it. I would also recommend TweenLite for fading and volume control it works a lot better than native flash stuff.
-
6. Re: touch event singleton
Anton Azarov Feb 7, 2012 1:06 AM (in response to Mark.Raykhenberg)Code of topic starter is wrong =) As I said in another topic - you need firstly check if current touchPoindID == exact finger

