[Flash Development Notes] about the Aso files in Flash

Source: Internet
Author: User
Tags export class

This strange thing happened today:

For some reason, I changed the system date one month earlier, and then compiled a flashProgram(There are many as2.0 classes in Flash programs ).

Later, I changed the system time back to the normal time, and then modified someCodeWhen the Flash program was released, some strange things appeared. The code I modified didn't work. How can I modify, compile, and restart the Flash program is the old code before the modification.

Then I performed tracking and debugging, but found that the newly modified code was inexplicably skipped and not executed, which made me even doubt whether there was a problem with the flash compiler...

In about a thousand seconds, this seems to drive me crazy. I thought something was cached, So I restarted the computer, but the result is still the same.

Then I thought: this may also be related to changing the system time, But what time-related things does flash generate?

...

After a few minutes of silence, I suddenly saw a bright eye. I remember that there was a "delete Aso file" in the control menu. Is it related to this?
Run this command and compile it again.
This menu command is not commonly used. I didn't want to use it today. So what is the Aso file? It seems necessary to have a good understanding of it. for help, the description of the Aso file is as follows:

(from flash help: Class> compile and export class> Use Aso file)
during compilation, flash sometimes creates an extension under the/ASO sub-directory under the default global class path directory. aso file.
(the Aso is cached in the following directory: C: \ Documents and Settings \ Yao \ Local Settings \ Application Data \ Macromedia \ Flash 8 \ zh_cn \ Configuration \ Classes \ Aso \)
. the Aso extension represents the ActionScript object (ASO ). Flash will generate an Aso file for every ActionScript 2.0 file that is implicitly or explicitly imported and successfully compiled. This file contains the bytecode generated from the relevant ActionScript (AS) file. Therefore, these files contain the compilation form (bytecode) of class files ).

flash must regenerate the Aso file only in the following cases:

The corresponding as file has been modified.
The ActionScript files that contain the definitions imported or used by the corresponding ActionScript files have been modified.
The ActionScript file contained in the corresponding ActionScript file has been modified.
The compiler creates an Aso file for caching. You may notice that the first compilation process is longer than the subsequent compilation process. This is because only modified as files are recompiled into Aso files. For unmodified as files, the compiler directly reads the compiled bytecode from the Aso file instead of re-compiling the as file.

The Aso file format is an intermediate format developed for internal use only. It is not a document file format and will not be re-distributed.

If you encounter an issue of compiling an earlier version of an edited file in flash, delete the Aso file and re-compile it.

According to the last sentence, it is clear that flash has compiled the early Aso files. That is to say, my as class has been modified, but the Aso file has not been updated. How is the "early version" maintained here? Why does the Aso not be updated? Or, how can we determine that it is an earlier version?

The answer is clearly that this early version depends on the generation time of the Aso file. If the Aso time is earlier than the current time, you can modify the as class, it will not be re-compiled, But I have modified the system time and compiled it once. After the system time is changed back, no matter how it is compiled, this Aso is the latest version in terms of time, this is why the problem described in my document appears.

Speaking of "early versions", I really hope Flash can have a real version signature function. For example, I published a program (SWF ), some other subprograms (SWF) are dynamically loaded in the program, but a new version of the program or subprogram is released after a certain period of time. In this case, the browser will cache the old version, to view the new version, you must manually clear the cached old file to view the new file. If the version signature function is available, flash will automatically detect and reload new files. How good is this.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.