Overriding default functions in as3?

  • I have seen this alot, and every time I saw it i thought i wouldn't need it, and now all of a sudden I need it :P and can't find it anywhere

    I'm looking to speed up my game, and I know that people keep saying the default prototypes are slow, and so I'm wanting to swap them out with better ones, like I found one that makes split() 10x faster than default...

    Can anyone help?

    Also does anyone know if we can monitor what variables are using how much ram and things like that?? To see what's laggiest in the game?


  • Yeah I found one code logic problem recently, while trying to figure out why my map wouldn't display when going a specific direction. (like the corners wouldn't appear sometimes), and I found that in the loop, I would create more parts of the loop, but never tell the loop to continue looping, but with a bigger area... that I think caused a little slow down (trying to loop something that didn't exsist, or not looping when it was suppose to)

    I guess I'll just have to do it the old fasion way of carefully reading the code :(


  • Yeah the problem with all the changes I found was that they never specified which AS version. I am just desperate to try to increase performance.

    Still is there any way possible that I can figure out what parts of my code are heavier? like if there is a memory leak somewhere.. I'm not sure if that's really possible to find out.. because I imagine it would be a very well known program if it were possible


  • Chances are what you found is not AS3. Also, there is no way to redefine those functions in AS3. You would have to make your own definition meaning you would need to replace whatever you are using now with your new definition's usage. Before doing that, though, you should make sure that what you are using is in fact faster. Some things could have changed with AS3.


  • Yeah the problem with all the changes I found was that they never specified which AS version. I am just desperate to try to increase performance.

    The syntax would make it pretty clear if you know what to look for, even without specification.

    Anyway, you can usually change the sort of input that you give your application and see if the slowdown still occurs. For example, if you use really tiny images (assuming you are using images) and the problem ceases to exist, then there's probably a high probability (haha) that your error lies in that portion of the code. On the other end of the spectrum, you could use formal proofs to prove that certain sections of your code will only do certain things, and if you know that those things won't cause slowdowns, then you can be somewhat certain that those sections aren't the cause of the problem.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Overriding default functions in as3? , Please add it free.