Delete [fmx]

I have a question about a delete command inside a mouse event, imagine: I have an mc on stage and attach to this mc, some code(flash 5 style)
onClipEvent(enterFrame){
if(something){
something
delete this.onEnterFRame
}

}
but this dosen´t work, but in thae case I put this code in a frame in the timeline (flash mx style)

the code works

Why this works

thanks in advance