Archive for September, 2007

Namespace conflicts

Thursday, September 13th, 2007

Here’s a pretty nasty thing that had me scratching my head for a while. I was trying to test an AS2 class, and kept getting this error:

/uk/co/steamboy/ClassB.as: Line 2: The name of this class, ‘uk.co.steamboy.ClassB’, conflicts with the name of another class that was loaded, ‘uk.co.steamboy.ClassB’.

I rewrote the classes as skeletons, so it wasn’t my code, but the problem persisted.

Turns out that the problem was that I was working on a server and the local time and the server time were out of sync, so it appeared to Flash locally that the files had been written in the future. Flash stores a copy of the class in the ASO cache, and because the server version was newer than the local version, it was not updating and causing the error. To correct the problem, I got the server hosts to reset the server clock and the problem disappeared. A simple solution if you can’t do this is to reset your local system clock to be ahead of the server, or alternately, make sure that you always work on a local copy and then upload to the server when you need to.

Another problem could be that to ASO cache becomes corrupted. To fix that, you’ll need a couple of JSFL commands from here.
Download the files, run extension manager, restart flash and run from the command menu…