Trick/bug

I was fooling around with classes and stuff, and noticed that if you have this code for your class…


dynamic class test {
	var i=1
	function option() {
		trace("intail")
	}
	function option1() {
		trace("second option")
	}
	function option2() {
		_x+=1
		trace("going")
	}
	function onPress() {
		switch (i) {
		case 1:
		onEnterFrame = option
		break;
		case 2:
		this.onEnterFrame = option2
		break
		case 3:
		onEnterFrame = option3
		break
	}
	i++
	}
}

and a simple MC thats placed on the stage with attach movie. When you click on the movie clip twice it will run two onEnterFrame actions. Becuase the second click used the case code which is the this.onEnterFrame instead of onEnterFrame…Might Be common sense but i thought it was cool.