Image Sprite: Flung VS Touch

Hello, Everybody!

Pls help me to understand:
I want to have two different functions on Flung and Touch to ImageSprite, is it possible?
In my .aia file you can Flung image (it will slide image to left-right) and Touch it (it will change image Color).
When we flung image, the Touch function works too.
But I want to have Flung and Touch functions separately. How to achive this?
Flung_VS_Touch.aia (3.4 KB)

As I read in manual:

Touched( x , y )
When the user touches the sprite and then immediately lifts finger: provides the (x,y) position of the touch, relative to the upper left of the canvas.

"Immediately". But even if I Flung very slowly, anyway the Thouch function works.

you can try to check the speed or heading in the Flung event...
it it is only a Touch, then these values probably are very small?(just guessing here...)

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Good idea, but in Touched block there are only X and Y, no speed or heading.

I tried to imitate Thouched function in Flung block by speed=0, but no effect, it doesnt want to understand touches.

Try it:

Thanks! I made the same blocks, but it seems to be not working.
When Flung, the Touching also occurs.
Flung_VS_Touch (1).aia (24.5 KB)

It works, but not completely correct. After flung, you have to touch twice for the Touch event to happen. Unfortunately, the Touch event is executed first, then Flung, which complicates the matter.

Maybe if you use the TouchDown and TouchUp events, and save the locations and times (ms) of those events, you could use that data to distinguish between a simple touch and a Fling?

I was also thinking about it to use the clock component. It should work.