The error is looking like a problem with the graphic for sure there are two things you should do to provide more information
Post the whole script but if i had to guess with just the one line of code you have a syntax error like a missing () on your method or you have a error with the graphic processing if you added a custom one to the event