Flash Function ?

Out of context: Reply #7

  • Started
  • Last post
  • 8 Responses
  • loahn0

    the "delete" function in flash is a fine alternative to setInterval/clearInterval.

    delete this.onEnterFrame is good and will not pysically/textually delete the prototype, class of function that is running. It'll just stop the script from running temporarily for the instance that addresses it. Its a good idea to use trace() actions to report the surrent status as flash doesn;t always evaluate Maths to an expected value.

    e.g. you have am onEnterFrame running and you're checking if _xscale == 100 it should delete the onEnterFrame. However, flash will probably only accurately get to 98.7 c.a. which will cause the script to run forever as it never reaches its target of 100.

    In short you'll need to tweak it so it rounds up or down to a whole number.

View thread