I'm using a class with an instance name of textParser1. After creating the instance I want to be able to use a property of the class, but the value that is returned appears to be returned too soon (i.e. before the class has finished processing completely).
Here's what I want to do:
textParser1 = new TextParser(content);
I believe the solution is to create a custom event, but don't know how to do this. Here's what I think I should be doing:
textParser1 = new TextParser(content)
Is this correct and can you point me to an example of the right way to do this.
Thanks for your time.
Make sure your Parser implements IEventDispatcher or extends EventDispatcher.
Then dispatch a custom event like this (inside of Parser):
dispatchEvent( new Event( "custom" ) );
Then listen for the event like this:
parser.addEventListener( "custom", customHandlerFunction );
Let me know if that helps...
That worked. Fantastic!
Thanks for the reply!
Good deal! (Please hook me up with the "correct answer" points!) Thank you.