FMX problems with moving code

suppose i have the following code on a movieclip
[AS]
onClipEvent(load){
var someVariable = 0
someFunction = function(){
//do something
}
}
onClipEvent(enterframe){
someVariable++
if(!_parent.something){
someFunction()
}
}
[/AS]

and i want to put that code INSIDE a frame of the movieclip instead of ON the movieclip, i would have to use this.onLoad = function() {blah blah} and this.onEnterFrame = function() {blah blah} and you would suppose it would work the same, but it doesnt work at all. Am i doin something wrong? i appreciate all comments/advice/etc…