Flash CS4 refuses to let go
Asked Answered
O

7

2799

I have a Flash project, and it has many source files. I have a fairly heavily-used class, call it Jenine. I recently (and, perhaps, callously) relocated Jenine from one namespace to another. I thought we were ready - I thought it was time. The new Jenine was better in every way - she had lost some code bloat, she had decoupled herself from a few vestigial class relationships, and she had finally come home to the namespace that she had always secretly known in her heart was the one she truly belonged to. She was among her own kind.

Unfortunately, Flash would have none of that. Perhaps it had formed an attachment. Perhaps it didn't want Jenine to be decoupled. Either way, it clung to the old, perfect version of Jenine in its memory. It refused to move on. It ignored her (function) calls. It tried to forget her new, public interfaces. Instead, every instance of Jenine that it constructed was always a copy of the old version, down to its classpath:

var jenineInstance:Jenine = new Jenine();
trace( getQualifiedClassName(jenineInstance));
// Should print: com.newnamespace.subspace::Jenine
// Prints: com.oldnamespace.subspace::Jenine
// Ah, young love!

We fought. I'm not proud of some of the things I said or did. In the end, in a towering fit of rage, I deleted all references of Jenine completely. She was utterly, completely erased from the system. My cursor fell upon the "Empty Trash" menu option like the cold lid of a casket.

I don't think Flash ever recovered. To this day it still clings to the memory of Jenine. Her old, imperfect definitions still float through my project like abandoned ghosts. Whenever I force Flash to compile, it still lovingly inserts her into my movie, nestling her definition in amongst the other, living classes, like a small shrine. I wonder if they can see her.

Flash and I don't really talk anymore. I write my code, it compiles it. There's a new girl in town named Summer who looks almost identical to Jenine, as if someone had just copied her source-code wholesale into a new class, but Flash hasn't shown any interest. Most days it just mopes around and writes bad poetry in my comments when it thinks I'm not looking.

I hope no one else has had a similar experience, that this is just a singular, painful ripple in the horrifying dark lagoon that is the Flash code-base. Does anyone have any idea how to erase whatever cache the compiler is using?

Ogletree answered 3/2, 2010 at 17:32 Comment(0)
C
711

Flash still has the ASO file, which is the compiled byte code for your classes. On Windows, you can see the ASO files here:

C:\Documents and Settings\username\Local Settings\Application Data\Adobe\Flash CS4\en\Configuration\Classes\aso

On a Mac, the directory structure is similar in /Users/username/Library/Application Support/


You can remove those files by hand, or in Flash you can select Control->Delete ASO files to remove them.

Cammie answered 3/2, 2010 at 18:49 Comment(3)
Copied from below: This and the other, very similar answer are exactly what I was looking for, but unfortunately don't seem to solve the problem. I'm going to chalk this one up to Adobe bug fun tiem. I'm going to mark it as solved, however.Ogletree
PS: I've clicked the menu item over and over. I've plunged deep into the file structure in a quest to finally expunge the files that contain the last echoes of Jenine. They aren't there. When I ask about them, Flash just mumbles something incoherent and stares off into space. I think I can start to hear something over the mad hammering of my mouse button. Jenine is laughing.Ogletree
@Ender, do you experience the same problem if you freshly compile the code on a new box. Like a fresh checkout of the code onto a new computer? This should tell you whether or not it is a problem with the code or things lingering on your filesystem*.Nuthouse
R
198

Try deleting your ASO files.

ASO files are cached compiled versions of your class files. Although the IDE is a lot better at letting go of old caches when changes are made, sometimes you have to manually delete them. To delete ASO files: Control>Delete ASO Files.

This is also the cause of the "I-am-not-seeing-my-changes-so-let-me-add-a-trace-now-everything-works" bug that was introduced in CS3.

Raynold answered 3/2, 2010 at 18:40 Comment(0)
T
163

What if you compile it using another machine? A fresh installed one would be lovely. I hope your machine is not jealous.

Telemotor answered 3/2, 2010 at 20:25 Comment(0)
M
126

I have found one related behaviour that may help (sounds like your specific problem runs deeper though):

Flash checks whether a source file needs recompiling by looking at timestamps. If its compiled version is older than the source file, it will recompile. But it doesn't check whether the compiled version was generated from the same source file or not.

Specifically, if you have your actionscript files under version control, and you Revert a change, the reverted file will usually have an older timestamp, and Flash will ignore it.

Mattson answered 3/2, 2010 at 18:4 Comment(1)
True, I work on several projects with developers from South Africa and London. When we hand off flash files back and forth, we have to save it locally, as compiling will cause a crazy error based on the timestamp of the file. Essentially, trying to compile a flash that's been saved in the future is the issue. We figured it out by changing our date on our OS's. Try checking your timestamp.Harrington
A
103

Also, to use your new namespaced class you can also do

var jenine:com.newnamespace.subspace.Jenine = com.newnamespace.subspace.Jenine()
Assr answered 5/2, 2010 at 16:55 Comment(0)
W
96

Do you have several swf-files? If your class is imported in one of the swf's, other swf's will also use the same version of the class. One old import with * in one swf will do it. Recompile everything and see if it works.

Weasel answered 4/2, 2010 at 4:26 Comment(1)
Yeah I am betting Jenine is compiled into some other part of your code, either a swf or a swc you are using.Assr
E
11

Use a grep analog to find the strings oldnamespace and Jenine inside the files in your whole project folder. Then you'd know what step to do next.

Endymion answered 2/7, 2013 at 1:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.