Flash 8 tip – class caching with ASO files

4 09 2007

We came across this weird problem in Flash 8 and finally Scott was able to solve it by deleting ASO files. Thought it might be helpful to others who have similar problem.

Here is the problem, we had a MovieClip in the library with a AS2 class associated. The AS2 class extends MovieClip and had been working fine. For some reason, after we made some updates to the class, Flash stopped updating the class – when we published it, it appeared to have compiled an older version of the class file. (It seems some older version of the class is haunting the swf or something.) When we gave the class a new name, and change its linkage in the library, it would fix the problem. But when we changed the names back, the problem showed up again. The problem remained even after we restarted Windows.

The solution was easy enough – just go to the Menu on Flash 8, select Control -> Delete ASO files. It worked fine again.

The following is what Flash 8 documentation has to say:

Using ASO files

During compilation, Flash sometimes creates files with .aso extensions in the /aso subdirectory of the default global classpath directory (see About setting and modifying the classpath). The .aso extension stands for ActionScript object (ASO). For each ActionScript 2.0 file that is implicitly or explicitly imported and successfully compiled, Flash generates an ASO file. The file contains the bytecode that’s produced from the associated ActionScript (AS) file. Therefore, these files contain the compiled form (the bytecode) of a class file.

Flash needs to regenerate an ASO file only when the following scenarios occur:

* The corresponding AS file has been modified.
* ActionScript files that contain definitions imported or used by the corresponding ActionScript file have been modified.
* ActionScript files included by the corresponding ActionScript file have been modified.

The compiler creates ASO files for caching purposes. You might notice that your first compilation is slower than subsequent compilations. This is because only the AS files that have changed are recompiled into ASO files. For unchanged AS files, the compiler reads the already-compiled bytecode directly out of the ASO file instead of recompiling the AS file.

The ASO file format is an intermediate format developed for internal use only. It is not a documented file format and is not intended to be redistributed.

If you experience problems in which Flash appears to be compiling older versions of a file you have edited, delete the ASO files and then recompile. If you plan to delete ASO files, delete them when Flash is not performing other operations, such as checking syntax or exporting SWFs.
To delete ASO files:

If you are editing a FLA file, and you want to delete an ASO file, select one of the following in the authoring environment:

* Select Control > Delete ASO Files to delete ASO files and continue editing.
* Select Control > Delete ASO Files and Test Movie to delete ASO files and test the application.

If you are editing an ActionScript document in the Script window:

* Select Control > Delete ASO Files to delete ASO files and continue editing.
* Select Control > Delete ASO Files and Test Project to delete ASO files and then test the application.




3 responses

5 09 2008

Thank you so much for publishing this. This issue has haunted us for months. With multiple developers editing class files and FLAs, we could not understand how the same FLA, linked to the same AS files, published from different machines could generate different results.

19 09 2012
mozilla firefox

Greetings! I’ve been reading your site for a long time now and finally got the courage to go ahead and give you a shout out from Houston Tx! Just wanted to say keep up the good work!

11 04 2013
silver jewellery designers

Very great post. I just stumbled upon your blog and wanted to mention that I have really loved browsing your weblog posts.
In any case I’ll be subscribing for your rss feed and I hope you write again very soon!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: