Hi Jeff,
This kind of project pretty much screams for a 3D application that can do parenting. In your case, the end of the flap would be parented to the other half, which would be parented to the box. You would be able to determine where the “hinges” are on each object and animate all of the angles, so the end folds toward the other half of the top as they both move to their final position.
Many 3D apps do this – some like Lightwave, Maya, Cinema 4D, etc. cost a fair amount of money. You can animate the “bones” of the objects and even use inverse kinematics. You might also be able to do it with Blender or other free 3D apps. As I said, ProAnimator does some amazing things – but it’s not the best choice for this kind of animation.
Jon