EventListener

Hello

I have at the moment lame code like:

frame 1
if (nameObject != null){doSth(); stop();}

frame 2
gotoAndPlay(1);

I need better form of checking if my object get data.
So if somebody know how use events or similar efects on objects and will help I will be happy.(In real i’m using Timer [in-time-delayed/repeated-function], but its same, just without frames)

Thanx a lot