Skip to main content
Known Participant
January 16, 2013
Question

Accelerometer smoothnes

  • January 16, 2013
  • 1 reply
  • 818 views

I don't know how to use Accelerometer and to have smooth animation of that object(vector), I just need it to go to one side of the screen and to another when mobile device is moved in that direction (left or right).

I used acceleromete basics but besides its very choppy movements, it goes off the screen and doesn't stays inside.

Thanks

This topic has been closed for replies.

1 reply

sinious
Legend
January 17, 2013

Please provide some code examples of how you're utilizing the accelerometer.

Aside that you're most likely not moving objects on a fast enough speed (either ENTER_FRAME with some custom easing or using a Twen engine like TweenLite ( http://www.greensock.com )).

mari8899Author
Known Participant
January 17, 2013

I'm just starting to use it don't have any code yet except that codesnippet, so if you could provide me one example that would be great. I just need one object moving from left to right without going off the screen.

thanks!

Inspiring
January 17, 2013

Here you can find some really useful tricks to enhance performance of flash-tweens for mobile devices.

Especially this tip should be related to your problem:

Use cacheAsBitmap and cacheAsBitmapMatrix

If you have vector object that you’d like to animate in your project remember to cache them and then animate; remember also to set your application with GPU acceleration and you can see a really good performance with this technique.

Avoid to cache objects that you need to remove from display list, it will be so expensive for your memory.

Here is a video from Adobe with code examples that shows exactly the problem you are facing.