Delayed time-gap in flash cs3 while coding on the timeline

I would like to understand if such a problem exists in flash cs3 or is it just me.
My problem is that while I try to code on the timeline in cs3 using as3 i hav encountered this issue of “[COLOR=DarkRed]null references[/COLOR]” every time i change frames.

let us assume I have 4 frames . withs buttons oR movieclip in each OF them. i have a code on all the frames each corresponding to the movclips present on that frame. so when i go from frame 1 to 2 and i have a code in frame to which is something line “mc.addEventListener(event, func)” flash throws an error of null reference … which after a lot of frustration I realized that my code was executed atleast 300 milliseconds before flash realizes that there are objects on that frame.
My fix was
1. timers events call the function or

2. stage.addEventListener(event,chk) 
function chk (){
    //remove event listener
    // execute code


I would like to know if this is a known bug of cs3 or not… Also if there is any other solution to this…