Parallaxr help is much appreciated effect with Box2D and AS3

Hi All,

I am new to this forum and Box2D, since my animation tool is Flash I am wondering if there is any way I can use Box2D for parallax effect. I tried Flash way but while testing in device central it goes out of memory, not sure why?

Can someone point out few suggestions or tutorial where I can start on the parallax and gestures (such as touch events, swipe etc.) using Box2D for touch devices? Your help is much appreciated.

Thanks in advance.

shri2ns
I'm not sure if I'm understanding you correctly, but I don't think Box2D will be the right tool for the parallax effect, as it is a physics engine, not a visual/graphics engine.

For using Flash for the parallax effect, what exactly are you doing to do that? It may have been running out of memory because it may be creating a new instance of the background/whatever each frame without properly clearing all of the references to the instance.
Hello,

Thanks a lot. Looks like I misunderstood Box2D, you're right it's a physics engine. Actually I want to create a parallax background (using two pngs) for touch tablets. I followed tutorial at http://www.gotoandlearn.com/play.php?id=96 about Flash parallax effect and was trying to create swipe effect for the same (after making same example with gesture events), it works for one or two times but then gives memory issues.

Thought there may be some way to make it work with Box2D.

Thanks much!

shri2ns
Yeah, Box2D isn't going to help with anything in this case.

How large are the images you're using? If you're using PNG(s) without using transparency, you should use JPG(s) instead (so if you're using a large PNG background with no transparency, use JPG).

Are you doing the swipe effect with motion tweens or changing the x (and/or y) properties by code?
At this time I am using x and y properties, it's not a great experience so far. I am looking into using tween though.

I do have another question about Box2D, I will open new thread for that.

Thanks a lot.

shri2ns
It should be ok to use x and y properties, since motion tween really is just changing x and y properties. It may be just the (file)sizes of the images you're using.

Original thread: https://box2d.org/forum/viewtopic.php?t=7869