« Internationalization/localization in Flash applications | Main | DataBinding and Date/Number Formatting in FMX2004 »

December 17, 2004

The name of this class conflicts with the name of another class

This isn't really new but it took us a while to resolve the problem so I thought it would be useful to blog it in case others come across the same problem some time.

I fired off some new AS2 class files to a client a few months back, the code had been tested and was OK.

When the client ran the code a few minutes later they got an error "The name of this class, XXX, conflicts with the name of another class that was loaded XXX." Both class names were the same in the error message.

I was stumped as to what the problem was and I just couldn't simulate the problem either. There were no duplicate files, nothing funny about the classpath, deleting the .aso files didn't resolve the issue either.

Well over that weekend the problem just went away.

So we sort of just forgot about it, put it down to the client doing something stupid, but again yesterday we had the same problem this time with another client.

This time we dug a bit deeper and finally uncovered the problem.

We are based in Asia and the client was in the U.S. We produced the files sometime on Wednesday morning and sent to the client where because of the time zone difference he ran them on Tuesday night.
Bingo! The Flash compiler objects to processing files which are dated in the future. If the class file has a timestamp ahead of your own PC clock then you get the error.

Solution for developers:
1) Move to California or better Hawaii so everyone on the planet is behind you.
2) Change your system clock back by 24hrs and work in the past.
3) Wait 24hrs before sending out anything
4) Hope MM fix the compiler some day.
5) Ask the client to edit your files to get the timestamp to change.

Forewarned is forearmed as they say.

Comments

I also get this error if I try to compile files on a network drive, even if the timestamp is ahead or behind the local computer time. ick!

A client and I had the same problem this morning... only, he's in Calinfornia, and I'm in Atlanta. However, the problem did just "go away".

Jester,
Yep if your in the US with only a couple of hours time diff then the problem does just "go away" that much faster. lol.

Ash,
Never come across that prb, but must admit whether flash, java or pascal I have never compiled against source on network drives always used a vcs and got the files from the vcs to my local drive before building, but thats no excuse for it not to work however.

I ran into this problem often, workin on a network drive. I found than the clock of my server and the one of my desktop are not synch. I installed a little software that synchs the clocks on a web server automaticaly on a defined schedule. Never had the problem after.
MM never corrected this in the updates, hope they will in the next version!

I like solutin No. (1) and (3). I am against having the client to do anything than just pay me and press buttons!

"1) Move to California or better Hawaii so everyone on the planet is behind you."

Wrong.. that would make everyone in front of you. If you want to be in front of everyone move to New Zealand or the Western Pacific.

bruceyeah,
Moving to California is the correct solution, but your right I should have said "in front". Moving to NZ makes the problem worse, maybe this accounts for the low number of progammers in NZ and the high number of sheep.

Did you drop a note "I want to compile files time-stamped in the future because of west-to-east travel" into the request box? (For myself, I haven't happened to have come across similar conversation in the past.)
http://www.macromedia.com/go/wish/

tx, jd/mm

That comment with the "Braj" name is not me! It is even linked to my website.

Brajeshwar - Noted and I will remove it.
JD - Hmmm, I have now!

Thank you, thank you, thank you!

The most anoying bug ever!

I just got this error and in bad timing! It doesnt do it though if I were to attach the class to my clip by means of the linkage in the library.

I keep getting this compile error no matter what I do. I have tried setting my PCs clock back, moved the files to my own machine but it won't compile anyway. Trust me, I have checked for mispelt words, spacing, semicolons, the lot without finding anything. I even re-installed Flash MX 2004 Pro to no avail. If anyone have any other possible solutions, please email me. Thanks!

Thought my email would show... its thobias@liverpool.ac.uk

Absolute Genius! Had the same problem when I brought a file home from work. checked my home clock and was turned back 3 years. ooops!

This was the first time I ever got this message. After a couple mins of checking my code I was stumped. I googled the error message and got this page. Thanks for posting it, it saved me hours I'm sure.

Doh! Been googling for a solution to this error before, but this is the first time I see this page.

I've had this error on and off for a long time. And now I know it was because the network drive was 5 minutes ahead. Thanks guys =)

This problem has cost me probably £2000 in lost employee hours over the last two weeks. It got so bad, we were working to a tight deadline and we actually had to send a courier to pick up the one computer that could compile our files properly and bring it to the office. :-(

I was hitting this problem when using the System.setClipboard() function in a class. I fixed it by explicitly importing the System class at the top of the class (import System;)

Scratch that above comment. Didn't work. F@#$**ing POS!

Thanks so much for posting this. This problem was driving me to distraction. After reading your post, I resaved all my class files to get the timestamps all in line, and then it all worked fine. This MM compiler is just awful I'm sorry to say. MTASC has sped up my work no end.

Since this is somehow the first result on google concerning this error i'll post the solution ive found.

There is a flash extension by MM, download it and use the ASO Clear Cache command.

flash extension:
http://www.macromedia.com/cfusion/exchange/index.cfm?extid=1016963&view=sn111

This is still an issue with Flash 8 (even with MM/Adobe's addition of 'Delete ASO Files'). Wish they'd fix this!

The extension works great; but don't use the Check Syntax feature after you clear the cache (until you recompile everything), or you'll get the same error again.

Wow. Great to know!!! I'm developing a time-based app, so I'm constantly changing the system clock to simulate different settings; couldn't for the life of me figure out why this kept cropping up randomly.

Actually, objecting to future-dated class objects, if you think about it, is probably a "feature" rather than a bug...probably something MM left in from testing the environment.

Thank you for this post. It's saved me hours of hunting.

Thank you! You've saved my life!

Our file server is a samba share on a linux server. So we have the same problem. A partial solution is to change the modification time of the file with the linux touch command.
e.g. touch -t 200707101400.00 Gallery.as
This will set the creation time to july 10th 2007 14:00:00
If you manage to compile the AS file once (without script errors) it will stay good ... until you delete the ASO files.

They still haven't fixed it in Flash CS3.. sadly...

The delete ASO Files command din't work. Re-saving all .as files did the trick. The fact that Flash developers have to do this is just annoying.

What is the name of the extension mentioned in several posts above? It seems the URL no longer brings it up - I think Adobe revved the Exchange since.

Thank you!

Search the exchange for this string:

ASO Cache Commands

The following links will get you the ASO Clear Cache Command
The link is:
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1016963

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)