AS code 2.0: The Flash Player 7
Related Tags:
Flash Player 7 than the previous Flash Player support more ActionScript order, you can use these commands to prepare more solid script. However, if the existing use of these scripts in order, and Flash 7 player against the publication of the script, it may not work correctly. For example, if you have a script, which is a function of the use of the Error, the script compiler may be correct, but it does not in accordance with the Flash 7 player mode operation, as in the present action scripting language is a built-in type Error (Therefore, the Error is a reserved word). May amend the script, changed the name of the Error function to solve other names, such as ErrorCondition.
Flash 7 player also made many changes, these changes affect how SWF files to a visit to another SWF files and how to load external data and how to set up and access the local data (such as privacy settings and local permanent shared object). Finally, some of the existing properties has also changed.
If your existing scripts are against Flash 6 or earlier versions of the players prepared, but would like to view Flash 7 player releases, you may need to amend your script, so that they comply with Flash 7 player and to the implementation requirements By design ideas work. Below we introduce these relevant knowledge.
1 to comply with the ECMA-262 Edition 4 programme
Flash 7 player made some changes to make it more in line with ECMA-262 Edition 4 programme. ActionScript 2.0 in the language, in addition to the use of technology based on the type of programming, has also been increased by other characteristics, certain acts have been amended. When you view Flash 7 player releases and the use of language ActionScript 2.0, you can not object type assigned to another. These functions do not require you to update the existing script, but if you confine your Flash 7 player release issued your script, you can use these functions, and then continue to be updated and improved.
And the above-mentioned changes in different, the following table presents the changes (some of which do not fully comply with the ECMA programmes) may lead to results of the implementation of the existing script and different from before. If you are against Flash 7 player releases existing scripts that use these features, please check out these changes, to ensure that your code can be run in accordance with the design plan, or to determine whether the need to rewrite code. In particular, undefined terms (undefined) of the results in certain circumstances is different, you should be against Flash 7 player in the initial release of all the script variables.
Against Flash 7 player released SWF files for Flash player for the early release of SWF files to support case-sensitive (case is different variables were interpreted as different variables). This change has also affected by # include directive contained in the documents and the use of LoadVars.load () printed in the order of external variables. Not case-sensitive (case is different variables were explained for the same variable). In numerical terms undefined in the context of the return of the results is NaN. In numerical terms undefined in the context of the return of the results is 0. MyCount = 1;Trace (myCount); / / NaN myCount = 1;
Trace (myCount); / / When an undefined items were converted to a string, the result is undefined. When the undefined be converted to a string, the result is "" (empty string). Firstname = "Joan";
Lastname = "Flender";
Trace (firstname middlename lastname);
/ / Joan undefinedFlender firstname = "Joan";
Lastname = "Flender";
Trace (firstname middlename lastname);
/ / Joan Flender When the string as the logical, if the length of the string> 0, the result is true, if the string is empty string, the result is false. When the string conversion to a logic value, it first converted to numerical, if the non-numerical 0, the result is true, it is false. When setting the length of the array, only the number of effective length of string can be set. For example, "6" play a role, but "6" or "6 xyz" ineffective. When setting the length of the array, even if the deformity is a string of figures can be set up Length: my_array = new Array ();
My_array [ "6"] = "x";
Trace (my_array.length); / / 0
My_array [ "6xyz"] = "x";
Trace (my_array.length); / / 0
My_array [ "6"] = "x";
Trace (my_array.length) / / 7 my_array = new Array ();
My_array [ "6"] = "x";
Trace (my_array.length) / / 7
My_array [ "6xyz"] = "x";
Trace (my_array.length) / / 7
My_array [ "6"] = "x";
Trace (my_array.length) / / 7
Second, the data set and local domain rules
In the Flash 6 player, when access to the local settings (such as cameras or microphones access licenses) or local permanent data (shared object), the default is to use ultra-matching rules. In other words, stored in here.xyz.com, there.xyz.com xyz.com the SWF files and settings and data is shared, and are stored in the xyz.com.
In the Flash 7 player, the default is to use precision-matching rules. In other words, here.xyz.com documents stored in the set-up and data storage in here.xyz.com, there.xyz.com documents stored in the set-up and data storage in there.xyz.com, etc. .
System.exactSettings new properties which allow you to specify the use of the rules. This attribute support for the Flash 6 or higher version documents issued by the player. The Flash 6 player for the documents issued, the default value of this attribute is false, which means that the use of domain matching rules. For against Flash 7 player released documents, the default value of this attribute is true, this means that the use of precision-matching rules.
If you use a permanent local settings and data, and want to view Flash 7 player issued a Flash 6 player, SWF files, you may need to release the document to the attribute value is set to false.
Third, SWF files between the sub-domain and cross-border visits
When you develop a range of communications SWF files, for example, when using loadMovie (), MovieClip.loadMovie (), MovieClipLoader.LoadClip () commands or local connection object, you may be these animation files stored in different domains or a super-sub-domain of the different jurisdictions.
Against Flash 5 or earlier versions of the documents issued by the players in the cross-border visits or subdomain unrestricted.
Flash 6 in response to the documents issued by the player, you can use the function or LocalConnection.allowDomain incident System.security.allowDomain () method to specify allow cross-border visits (for example, in the domain of documents someOtherSite.com someSite visit. com domain), and eliminates the need to use a command to allow subdomain visit (for example, in store.someSite.com subdomain can access a document in www.someSite.com subdomain document).
Against Flash 7 player in the document released, SWF files between visits with an early version there are two different aspects. First, the implementation of Flash 7 player precision-matching rather than super-matching rules. Therefore, the visit was a document (even for the early version of the Flash player rather than Flash 7 player released documents) must be explicitly specified subdomain or allow cross-border visits. Secondly, stored in the safe use agreement (HTTPS) sites in the documents, must be explicit permission from the designated use of unsafe Protocol (HTTP or FTP) site visit of the document.
Flash 7 player because of the implementation of precision-matching rather than super-matching rules, if you want to view Flash 7 player can access the documents issued by your existing scripts, you may need to modify these scripts. (You can still view Flash 6 player releases revised document.)
If you use LocalConnection.allowDomain in the document () or System.security.allowDomain () statements, and allows access to ultra-designated site domain, you must be amended to specify the parameters of your domain accurate. The following code that you may need to be modifications:
/ / Allow or stored in www.someSite.com store.someSite.com domain SWF file access System.security.allowDomain ( "someSite.com"); / / stored in www.anyOldSite.com domain SWF files in the Flash 6 Player order my_lc.allowDomain = function (sendingDomain) (return (sendingDomain == "someSite.com");) / / allow for Flash 7 player released SWF files to the corresponding order System.security.allowDomain ( "www. . someSite.com "," store.someSite.com "); my_lc.allowDomain = function (sendingDomain) (return (sendingDomain ==" www.someSite.com "| | sendingDomain ==" store.someSite.com "); )
If you are not currently using these words, you may need to add such a statement.
For example, if your SWF files stored in www.someSite.com domain, and you want to allow stored in store.someSite.com domain against Flash 7 player released SWF file access, you must be stored in the domain www.someSite.com Add the following statement of the document (you can still view Flash 6 player www.someSite.com release stored in the document):
System.security.allowDomain ( "store.someSite.com"); my_lc.allowDomain = function (sendingDomain) (return (sendingDomain == "store.someSite.com");)
In general, if you confine your Flash 7 player issued a document subject to the following conditions, you may have to modify your documents, add or modify allowDomain statement:
①-SWF files you write scripts using loadMovie (), MovieClip.loadMovie (), MovieClipLoader.LoadClip () or local connection object.
② was called SWF files (any version) is not stored in the safe use agreement (HTTPS) sites, or call and be called the SWF files are stored in the safe use agreement (HTTPS) sites.
③ SWF file is not the same domain, for example, a document in www.domain.com, the other in store.domain.com.
For this reason you need to do the following modifications:
① if called SWF files against Flash 7 player releases, to be called the SWF file contains System.security.allowDomain or LocalConnection.allowDomain statements, the use of domain names precise matching.
② If the document is called SWF Flash 6 player for the release, modification was called SWF files, or add or modify System.security.allowDomain LocalConnection.allowDomain statements, the use of precision matching domain names (such as the code shown in the previous section ). You can view Flash 6 or 7 players released revised document.
③ If the document is called SWF Flash 5 or for the previous version issued by the players against Flash 6 or 7 players released was called SWF files, add System.security. AllowDomain statements, the use of precision matching domain names (such as this section shown in the previous code). (Flash 5 and previous versions do not support the players connecting to a local object.)
4, SWF files from HTTP and HTTPS agreement to the visit
As a former discussed in the Flash 7 player in the domain of cross-border visits and the Rules have been revised. In addition to the existing implementation of precision-matching rules, you must be explicit that allow the use of unsafe agreement stored in the site visit to document stored in the safe use agreement (HTTPS) sites document. According to the document is to be called against Flash 7 player or for the Flash 6 player releases, you must implement a allowDomain statements, or use the new LocalConnection.allowInsecureDomain incident function or System.security.allowInsecureDomain () statements.
Warning: The Executive allowInsecureDomain () statements endanger HTTPS agreement to provide security. You can not only re-organize your site so that all the SWF files HTTPS acceptable agreement to do so when the service changes.
The following code that you may need to do modifications:
/ / Allow or stored in http://www.someSite.com http://www.someOtherSite.com / / for Flash 7 player released SWF files stored in a visit https: / / www.someSite.com / / Flash 6 player for the release of SWF files in order my_lc.allowDomain = function (sendingDomain) (return (sendingDomain == "someOtherSite.com");) / / allow for Flash 7 player releases / / stored in http: / / www.someSite.com or http://www.someOtherSite.com / / for Flash 7 player released SWF files to the corresponding order System.security.allowInsecureDomain ( "www.someSite.com", "www. someOtherSite.com "); my_lc.allowInsecureDomain = function (sendingDomain) (return (sendingDomain ==" www.someSite.com "| | sendingDomain ==" www.someOtherSite.com ");)
If you are not currently using these words, you may need to add such a statement.
Even if the two documents are in the same domain may also need to revise (for example, storage http://www.domain.com stored in a document called https: / / www.domain.com document).
In general, if you confine your Flash 7 player issued a document subject to the following conditions, you may have to modify your documents, add or modify sentences:
① you write the script cross-SWF files (using loadMovie (), MovieClip.loadMovie (), MovieClipLoader.LoadClip () or connecting to a local object).
② document does not call in the use of HTTPS protocol storage sites and was called SWF files stored in the safe use agreement (HTTPS) sites.
You must do the following modifications:
① if called SWF files against Flash 7 player releases, to be called the SWF file contains System.security.allowDomain or LocalConnection.allowDomain statements, the use of precision matching domain names (such as the section in front of the code examples below) . Even if the call and was called SWF files stored in the same domain, but also need this statement.
② If the document is called SWF Flash 6 or against the players before the release, and the call and be called the documents are stored in the same domain (for example, the document calls placed http://www.domain.com store at https: / / www.domain.com document), will not need to change.
③ If the document is calling for the SWF Flash Player version 6 releases, and call the document to be called not the same domain, and you do not want to view Flash 7 player is called export document, it is necessary to revise the paper is called, add or modify System.security.allowDomain or LocalConnection.allowDomain statements, the use of precision matching domain names (such as the section in front of the code examples below).
④ If the document is calling for the SWF Flash Player version 6 releases, and you want to view Flash 7 player released document is called, in the call contained in document System. Security.allowDomain or LocalConnection.allowDomain statements, the use of precision matching domain names (such as the section in front of the code examples below). Even if the two documents are stored in the same domain, but also need this statement.
⑤ If the document is called SWF Flash 5 or for the previous version issued by the players, and two documents is not the same domain, you can do two things. You can view Flash 6 player release is called document or amend System.security.allowDomain statements, the use of precision matching domain names (such as the code shown in the previous section), or you can view Flash 7 player released document is called, the use of precision matching domain names (such as the section in front of the code examples below).
5, allows access to the data server-side strategy document
Calling the use of these data loading, Flash documents can be included in data from external sources: XML.load (), XML.sendAndLoad (), LoadVars.load (), LoadVars. SendAndLoad (), loadVariables (), loadVariablesNum (), MovieClip . loadVariables (), XMLSocket.connect (), and Macromedia Flash Remoting (NetServices.createGatewayConnection). SWF files can also run into operation period of shared libraries (RSL) or other defined in the document SWf resources. In the default case, the RSL into the data must be stored or loaded with these external data or media SWF files the same domain.
To come from different jurisdictions SWF files to the use of data and operation of the shared library resources, you should use the cross-border strategy document. Cross-border strategy document is an XML document, it provided a way for servers to specify its data and documents from certain domain or all domain SWF files are available. Any strategy document from the server domain specified in the SWF files allows access to the server data or RSL.
If you are loading external data, even if you do not intend to view Flash 7 player release any documents, you should also create strategy document. If you are using RSL, and for Flash 7 player release and call the document is called, you should create strategy document.
- CSS style definition of the rolling code
- Optimizing your CSS code
- Css common code
- The magic code - CSS filter trip
- Some commonly used CSS code
- CSS control ul code base
- CSS code-switching function tab
- CSS code-writing techniques commonly used
- CSS code attributes Encyclopaedia (HTML)
- How to Optimize your CSS code?
- Js code and code folding effect css
- CSS code abbreviation skills zz
- CSS simple picture-Daolian code
- Clever css debug code
- HTML and CSS pages prepared by the beautiful formal code
- Summary: A CSS code reference map
- CSS code abbreviation skills
- Common CSS code
- CSS code structure of: the div and span!
- Css code explain




