unemployment Posted June 29, 2011 Share Posted June 29, 2011 How can I reference a function inside of a function using OOP. I am trying to do this. with_field.onkeydown = function(event){ associate_search.fill_list.down_key(event); } Where in another file I have this type of setup. function associate_search (){ this.fill_list = fill_list; function fill_list(){ //do stuff function down_key(event){ //do stuff } } } var associate_search = new associate_search; How can I reference the down_key function? Quote Link to comment Share on other sites More sharing options...
Adam Posted June 29, 2011 Share Posted June 29, 2011 You can't, it's out of scope. Only the parent function can call it. Quote Link to comment Share on other sites More sharing options...
unemployment Posted June 29, 2011 Author Share Posted June 29, 2011 You can't, it's out of scope. Only the parent function can call it. Thanks for letting me know. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.