AS Actionscript Optimization Tips

2010-08-12  来源:本站原创  分类:Flash  人气:118 

1 Create a new array to avoid using its constructor.

To do so  :var _test = [];
 Instead of doing  :var _test = new Array();

2 Create the array is a great consumption of the operation, so please be careful for the following types of operations:

var _city_1:Array = new Array(); 

var _city_2:Array = new Array(); 

var _city_3:Array = new Array(); 

var _city_4:Array = new Array();

3, the fastest way to copy an array is:

var _copyArray:Array =sourceArray( The original array name  ).concat();

4 No matter what way you are, set the value for the array element is a slow operation.

factory.push(machine); // Array name  .push( Elements or objects  )
factory[1]=machine; // Array name  [1]= Elements or objects  ;

5 in the array to get a value of speed is set to a value twice.

var factory: Factory= Factorys[1];

6, the attribute function is set to a static function, so use it when you do not need to instantiate a class object.

Example.toString(1);

Class definition:

package 

{ 

public final class Example{
public static function toString(_numInfo:uint) : String {
var _convertStr: String=uint.toString();
return _convertStr; 

   }
 }
}
相关文章
  • AS Actionscript Optimization Tips 2010-08-12

    1 Create a new array to avoid using its constructor. To do so :var _test = []; Instead of doing :var _test = new Array(); 2 Create the array is a great consumption of the operation, so please be careful for the following types of operations: var _cit

  • Experience summary: Java Performance Optimization Tips Collection 2009-08-28

    Experience summary: Java Performance Optimization Tips Collection

  • UC Optimization Tips 2010-03-25

    Optimization Tips: The following is the project I can see some of the UC optimization problems, and summarize a bit. This document I have UC, three days after the beginning of the optimize the creation, in optimizing the process of constantly add, mo

  • Oracle SQL Performance Optimization Tips Great summary 2010-08-03

    Oracle SQL Performance Optimization Tips Great summary (1) Select the most efficient sequence table name (only the effective rule-based optimizer): ORACLE parser in accordance with the order processing from right to left in the FROM clause of the tab

  • Google News Optimization Tips 2010-09-01

    Google News Machines algorithm to automatically aggregate news content and well-known, although it is not perfect. But what is certain is that no matter what your type of news sites, once selected Google News news source, it will give you a very impr

  • Baidu google keyword optimization tips 2010-09-01

    Website Keyword Optimization well in favor of Baidu GOOGLE and other search engines included, and to rank the top few search results page, you can increase website traffic, so webmasters have been in the pursuit of the best optimization techniques, a

  • Photo Search Engine Optimization Tips (Reprinted) 2010-09-16

    Photo Search Engine Optimization Tips SEO SEO for beginners on the basics have been in verse, and the current intense competition for keywords, but also give the web site image optimizing traffic to bring efficiency to the customer. Which brings me t

  • Oracle SQL Optimization Tips 2010-09-23

    Oracle SQL Optimization Tips Main aspects should be adjusted from 5 : 1. Remove unnecessary large-table full table scan 2. Cache small tables full table scan 3. Optimize the use of the index test 4. Optimized connectivity test 5. Implementation plan

  • Oracle SQL Optimization Tips chapter summary 2010-09-23

    Oracle SQL Optimization Tips summary article: (1) Choose the most efficient sequence table name ( Only rule-based optimizer in the effective ): ORACLE Parser in accordance with the order processing from right to left in the FROM clause of table ,FROM

  • 着陆页优化101招-中文全文pdf(101 Landing Page Optimization Tips) 2015-01-08

    原贴是 unbounce 上的长贴"101 Landing Page Optimization Tips",共分14章.一年多才翻译完,很慢,抱歉. "着陆页优化101招"中文全文PDF在此. "着陆页优化101招-chinese.pdf" http://vdisk.weibo.com/s/fEuFU

  • [Transfer] ActionScript 3.0 Performance Optimization Tips 2011-01-13

    This switched http://youyee.org/viewpoint/index.html Recently a lot of things are done and Flash development, in particular in optimizing the performance summarized to much experience to share to everyone here. Like other platform, Flash programs run

  • ActionScript 3.0 Performance Optimization Tips 2011-05-27

    1, the improved algorithm, both for what kind of program is always a good algorithm is very important, and can greatly improve application performance, so the first step is to optimize the performance of any algorithm or program logic from the optima

  • A collection of Java Performance Optimization Tips 2010-03-29

    === ================================ Abstract: ============= ====================== Procedures for the use of available resources (memory, CPU time, network bandwidth, etc.) is limited, the purpose of optimization is to allow programs to use the leas

  • SQL Optimization Tips oracle hint 2010-03-09

    Optimal adjustment of the database in SQL, it often will use HINT tips. Currently supported HINT ORACLE as follows: In the SQL statement optimization process, we often use hint, is to sum up the optimization process in the SQL usage in the common Ora

  • Ten DB2 database optimization tips 2010-03-29

    DB2 DBA to help avoid disaster and get high performance, and I for our customers, users and colleagues summarize a set of DB2 expert fault diagnosis process. The following detailed description of the Unix, Windows and OS / 2 environment using DB2 UDB

  • Java Performance Optimization Tips (1) 2010-08-19

    Before talking nonsense, nonsense that we all know. Any system can perfect, if you're after performance, you will definitely increase the workload, or increase the number of additional risk; If you are seeking security, then you will be missing in th

  • ActionScript uses Tips 2011-08-17

    Everyone knows that as a Flash developer, ActionScript is the basic language, how to use ActionScript to write efficient code? Today I compiled a simple code in detail only for the articles to share with everyone under their accumulation in this area

  • MySQL Database Optimization Tips Collection 2011-03-29

    First, what we can and should be optimized? Hardware Operating system / software library SQL Server (setup and queries) Application programming interface (API) Applications Second, optimizing the hardware If you need a large database tables (> 2G), y

  • Java Performance Optimization Tips Collection 2009-05-07

    =================================== Abstract: ============= ================== Procedures for use of resources (memory, CPU time, network bandwidth, etc.) are limited, the purpose of optimization is to allow the procedure to use as little as possible

  • Ten MySQL Optimization Tips 2010-04-24

    1. Optimize your MySQL query cache Query in the MySQL server, you can enable fast query cache. Let the database engine quietly in the background processing is to improve the performance of one of the most effective way. When the same query is execute