ActionScript style event model in C++