New to Box2D: Simple Impulse Questions.

So, like I said i'm still pretty new to Box2D, mostly just been fiddling with the examples, but a few questions cropped up in doing so. My main question is about the ApplyImpulse and ApplyForce functions, since they seems to operate similarly, at least parameter-wise. Anyway, heres the situation: I simply took the Hello World example and stripped out all the bodies except the ground and a single box. When i click the box I apply an impulse... simple. Problem being, regardless of the values i pass to applyImpulse the results seem somewhat random almost. I'm just trying to have the box pop straight up. Heres what i have so far:

private function onApplyImpulse(e:MouseEvent)
{
m_testBody.WakeUp();
m_testBody.ApplyForce(new b2Vec2(0, 2000000), new b2Vec2(m_testBody.m_position.x, 700));
};

I'll also mention that the density of the box is 3.0 and the gravity for the scene is 300. Not sure if those values are really out of whack, maybe thats why such a large impulse value is needed? Any suggestions as to common values you've found success with are welcome.

Also, when i use its X position there it seems to not work at all. When this says "applies an impulse to a point" is it asking for a directional vector (which would make sense and what ive run into in other physics engines) or is it asking for an arbitrary point in space relative to the world? relative to the rigid body? If it is a point in space, does it then apply the force along the direction from that point to the center of mass of the Object?

Lastly, should the force to lift the object off the ground be a positive Y force? or negative? the positive number seems to be the only value that results in any type of action (X values seem to do nothing), although negative makes more sense to me. I realize its all probably because of the random assortment of numbers i've been throwing in, so thats why im here, heh. Any help would be appreciated, code snippets would endear you to my heart forever, haha. In all seriousness though, thanks for your time.

-dh
First of all, short answer about impulse/force is that impulse is applied instantly, while force is applied over time. So you probably want to actually use ApplyImpulse here.

So your first vector how you have it set (at least for Flash) will push down. Y axis is positive to go down. That vector is applied to the world coordinate, so you can just call GetCenterPosition() on your body. So the reason I think you are getting strange results partly is because you are always applying the force at world coordinate 700 or whatever number you punch in for that run.
Thanks for the response, i didnt even realize i was using ApplyForce there. I was going back and forth between the 2 so much i guess i just left it by accident. no wonder it needed so much force to do anything, haha 😀 Once i cleared out all the random numbers i had been using and just started with all zeros things started to fall into place. Anyway, thanks again. Hopefully things will go a bit more smoothly from here, hehe 😁

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