Ok, in hindsight this does seem to be a silly problem I got myself into and shouldn’t have done in the first place.
I have a class Debug with a function called trace inside it which puts a TextField on the stage and outputs the text.
Now I am trying to get the Debug.trace() function to do a “normal” debug trace as well from within side itself.
of course this causes a recursive loop.
I am trying to figure out how I can access the top level separately. I tried using namespaces such as AS3::trace but to no luck.
I know a solution is to rename my function to stop the conflict, but I would like that to be a last resort. So people suggesting a DIFFERENT solution would be helpful.
It is being used in quite alot of places throughout my entire code so replacing it everywhere is going to be a ballache.
Thank you for any “different” solutions to the one above.
Since
trace()is a Top Level function and you’re ‘overriding’ it in your Debug class I don’t think it’s possible to call it in another way.A possible workaround could be to create a private class beneath your public Debug class. In there you could place a static method you could call which does the actual
trace()like so: