Ahoy, fellow Newgrounders! I seem to have a bit of a predicament on this... Maybe you can help?
I'm working on an event engine, something that allows a developer to add a list of boolean values and function references, so that if the boolean is true, it will call said function, and then wait for the next boolean in sequence to be called before moving on...
Some sample code as follows:
var script:Array = [
[n > 3, trace, "trace function called"]
It uses a script format that passes to a class which will parse these and call functions. As you can see, the boolean is (n > 3), where n is a variable on the main timeline. I'm having a bit of difficulty where the (n > 3) gets converted into a boolean value as soon as the swf loads, and then won't update to keep checking for the boolean.
I have found one solution to this, and that is to pass the script over to the class in an ENTER_FRAME method, so that it keeps getting updated that way. I find this a bit messy,and would prefer to do all of the "updating" under-the-hood inside of the class, so when reusing this class it will take minimal work and fuss to use.
Would anyone have any suggestions on how to fix this?
I'm trying to make an open-source game engine, so the quicker I get these classes done the quicker I can put this on NG :D
Thanks for anyone who is willing to help, it's always greatly appreciated!!!