Hey Everyone,
We are migrating to AS3 at my job and I have run across a weird bug (???). I use the same basic class structure for most of my projects:
Main.as - document class. handles preloader and sometimes XML loading, etc.
Navigation.as - the class that handles all menu buttons, etc.
Content.as - handles all the pages, game content, whatever.
I created a game with this basic structure and published the SWF. Everything works great.
Now, I built a website with this same basic structure and when I try to load the game SWF, it throws a bunch of runtime errors - it seems to be confused by the fact that the class names are the same. Each SWF works fine by itself. It only crashes when I try to load one into the other.
I should mention that both the game and website have identical package structure (because they are for the same client, duh!).
Is this a flash player bug or am I doing something wrong? I went through the website and renamed all of the classes and it fixed the problem, but my concern is that we may have to load SWFs in the future that we didn’t create. What if they have a similar issue? Unlikely, but possible.
Is there an AS3 equivalent to _lockroot to prevent this interference?
Thanks,
Andy