If statement

I need a written “if statement” for the following condition

If clip 1 exist in the clip 2.

clip 2 is attached to the main movie

clip 1 stops at frame 30

When observing the main movie there exist button 1

I want button1 to detect if clip 1 is at frame 30

if so then clip 1 gotoandplay(31)

Could someone write this statment for me.

Thank You