Simple question

Hi

I have 3 layers in my scene.
Layer 1 contains several keyframes and each keyframe contains text.
Layer 2 contains 1 keyframe and navigation buttons.
Layer 3 contains 1 keyframe and background.

My navigation button has simple code.
on (press)
{
_root.gotoAndPlay(x+1);
}
where x should be layer 1’s current frame.

My problem is that I don’t know how to get layer 1’s current frame number to variable x.

Could someone help me with this?