Passing Parameters on Contact

Is there a way to pass parameters of one body to another on contact?

I'm writing an "enemy" class where the enemy character walks on a platform from edge to edge (think Koopas in Super Mario Bros). I was thinking if I got the platform width and x position I could calculate the edges and turn the enemy around before it falls off. I was also thinking about putting 1px "bumpers" at the end of the platform. So when the enemy hit that, I could turn it around.

What's the most efficient/clean way to do this?

Thanks!
Johnny
I like the idea of having 'bumpers' placed around the level because it allows you to change the enemy behavior more flexibly - presuming you have some kind of graphical editor to edit your world of course.

The bumpers could be a sensor, so they don't need to be as small as one 'pixel', they could cover larger ranges. You could have different types of bumpers too, eg. the normal left/right like you mention, or speed up, slow down, pause, choose random direction, etc.
Btw, I figured it how to find display object parameters of touching bodies. Depending on what you're looking for (e.g. in this example, the ball or whatever it contacts), you'll have to change "GetFixtureA()" to "GetFixtureB()".

Code:
myBall.listenWhileVisible(myBall, ContactEvent.BEGIN_CONTACT, getContactParams);

private function getContactParams(e:ContactEvent):void {
     trace(e.contact.GetFixtureA().GetBody().GetUserData().width);
}

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