[Transfer] flash web experience a little bit of online games

2010-10-31  来源:本站原创  分类:Flash  人气:100 

A Journey to the West rich web version has also been inside for nearly a month, this time bug constant tinkering has not stopped though, but did not call earlier so busy. Development of online games is nearing 1 year web, and not much of experience, hard to write something, the only long-winded point is simple, casual regaling project development in some of the details of it, be under the sharing of experience.

1. On the configuration file management. Here are 2 methods:
a. hard-coded in a class as static methods available.
Advantages: high efficiency. Disadvantages: trouble updating it, modify the configuration files have to recompile a project.
b. For more configuration files, and modify the frequent items can take all the configuration files are packaged into a swf file, a class corresponds to a configuration file, in the document class provides these configuration classes call interface, so that the initial of the time also need to load a swf file, and capacity than the overall xml
Files are also much smaller, which also maintained to facilitate future updates.
General projects are used to combine the two. Here only scratch the surface of the offer a few ideas only.
2. On the rational use of resources. Because now flash's garbage collection soon to be tired, so here are some of the project is strongly recommended as far as possible reuse of resources, there are two ideas.
a. such as props in the game, basically a picture, for those unique components, such as equipment, field, ensure that only one instantiation, so that you can order a unique window as a resource pool, will add save the picture to set off a dictionary, when there is no corresponding picture in the dictionary when it is loaded. The advantages of doing so: 1> can be reduced and the number of save bandwidth connection to the server, 2> to reduce the image to load, so as little as possible of the lower frequency of garbage collection. Disadvantages: do so, the memory footprint will be relatively large, this can be based on project needs, and props such as pictures, are relatively small, basically using this method, a reminder, this time to clean up the data cache is more important.

b. This method is similar to the skin in the treatment of the flex. Reused many times and all the pictures of smaller capacity packed into a swf, the picture for each resource (
This includes not only pictures, it can be some animation mc, etc.) corresponds to a link name, the project called, the map is a Class
So you can only load a resource bundle to be inexhaustible resources corresponding to the call, this method is appropriate for those vector animation. The basic advantages and disadvantages above, a drawback is the added trouble of comparing this method, more resources, then the workload may increase a lot.
Of course, the premise of using these two methods is that when you care about memory usage situation, and ignore the garbage collection performance impact caused by short (ms
Now there is little abnormal player10 garbage collection), and references to determine some of the resources can be cleared for garbage collection after the above two methods ws.

3. On the registered event listener code. There seems to be winded, but still speak out of turn one plug, must remember to do the event listener
remove away, when the project bigger, when resources do not you worry be recycled, you think of the vast amounts of code to find those references not being cleared away, you will feel the pain of the needle in the haystack. Of course, the event listener is a reference to the situation, but this is only done small projects most likely to be ignored after a problem, the last sentence, the most important programming practice.

4. For external loaded swf, the scene in the animation when the play came after the conclusion of loading must remember to stop off the animation plays, flash9 exported animation will automatically repeat, if not remove the swf animation garbage collected, those who repeat the animation though not in front of you beat, but it is still for you to seize the cpu, when you find that there is no animation in the display interface, and no complex logic in dealing with the time found that when regular high cpu when low, to think about this situation it. I was once this injury previously found that did not do any computing time
cpu will actually run intermittently for about 30%, before the thought was forgotten where writing stopped the timer, the strenuous effort for even those who only discovered the remains in memory swf animation to engage in prank, really depressed for some time.

Wow, found that the night was deep, nagging them to be right, have no difficulty, in fact, some of the details in the project development summary only, personal view is that the algorithm for the project logic, in fact sort out the ideas, look up Data can be solved out, decided to develop a project schedule is actually the most easily overlooked details, and these will need to continue the accumulation of experience summed up. I wish I could give you a summary of some help.

相关文章
  • [Transfer] flash web experience a little bit of online games 2010-10-31

    A Journey to the West rich web version has also been inside for nearly a month, this time bug constant tinkering has not stopped though, but did not call earlier so busy. Development of online games is nearing 1 year web, and not much of experience,

  • flash web experience a little bit of online games 2010-11-03

    Easier to make money at home A Journey to the West rich web version has also been inside for nearly a month, this time bug constant tinkering has not stopped though, but did not call earlier so busy. Development of online games is nearing 1 year web,

  • [Transfer] and start of FLASH WEB GAME 2010-02-24

    ★ a long time to write something not that serious, and the 2010 New Year, sent a learned, I hope you can help. ★ the content is still perfect, the first paste catalog, please attention: → I → FLASH WEB GAME development process outlined in today's FLA

  • Turn - volcanic "flash web game" experience article 2010-06-08

    ★ my FLASH WEB GAME development process → 2007 In the summer, braving scorching sun, I went directly from school in Shanghai, started my entrepreneurial journey FLASH WEB GAME. Today, almost three years have passed. As the earlier group of FLASH WEB

  • My FLASH Complex 2010 - and the start of FLASH WEB GAME 2010-03-16

    Article Category: Flash programming ★ directory: → I → FLASH WEB GAME development process outlined in today's FLASH WEB GAME game → entrepreneurial companies face the problems and difficulties → FLASH WEB GAME system architecture → FLASH WEB GAME per

  • [Recommended] my FLASH Complex 2010 - and the business of FLASH WEB GAME (1) 2010-03-09

    ★ directory: → I → FLASH WEB GAME development process outlined in today's FLASH WEB GAME game → entrepreneurial companies face the problems and difficulties → FLASH WEB GAME system architecture → FLASH WEB GAME personnel division of the front-end arc

  • [Change] My FLASH Complex 2010 - and the start of FLASH WEB GAME 2010-03-09

    ★ directory: → I → FLASH WEB GAME development process outlined in today's FLASH WEB GAME game → entrepreneurial companies face the problems and difficulties → FLASH WEB GAME system architecture → FLASH WEB GAME personnel division of the front-end arc

  • [Recommended] my FLASH Complex 2010 - start of FLASH WEB GAME and (2) 2010-03-09

    ★ FLASH WEB GAME front-end structure and the personnel division of the front of the main program → structure and manpower and personnel module division and the division of labor is closely linked, which is again largely determined by the project itse

  • [Continued] my FLASH Complex 2010 - and the start of FLASH WEB GAME 2010-03-09

    ★ → front and Fine Arts with the old flasher who should know, FLASH software in the history of a long period of time are used for animation, flashers and art in this period of time this is the same root. Later, with the second edition of the AS1 and

  • [Recommended] my FLASH Complex 2010 - start of FLASH WEB GAME and (3) 2010-03-09

    ★ front-end and back-end and back-end with → FLASH varied means of communication, online tutorials too much, I will not cite. But very often, entrepreneurial team, as subject to a variety of realistic conditions, the options are not many. Like our co

  • FLASH Complex in 2010 - and the start of FLASH WEB GAME 2010-11-11

    My FLASH Complex 2010 - and the start of FLASH WEB GAME ★ directory: → I → FLASH WEB GAME development history overview of today's FLASH WEB GAME game → entrepreneurial companies face the problems and difficulties → FLASH WEB GAME system architecture

  • Flash 8 to create a cool Flash Web site 2010-04-10

    Using Flash to produce a [1b] Flash web site [/ 1b], very simple, hope that we grasp. Look at the results: Click here to download the source files (Unzip Password: www.webjx.com ) 1, the establishment of Flash document, modify the document properties

  • 30 program to improve the efficiency of a good Web experience 2010-07-07

    Avoid using DOM. When you need to repeatedly use the DOM, the first of the deposit to the JavaScript DOM reference to local variables in re-use. The method used to set innerHTML to replace document.createElement / appendChild () method. eval () probl

  • Some flash web game development experience 2010-08-25

    1. Show can not do without a game show, AS3 developers have to provide a more complete 2D display engine. Learning this part of the study show a list of DisplayObject and DisplayObjectContainer learning differences, learning Shape, Sprite, MovieClip,

  • [Turn] on a number of Flash web game development experience and his understanding of the solution 2011-01-01

    http://www.eb163.com/club/thread-16483-1-1.html Given the limited work experience, can understand that the current projects Flash games can have the following solution 1 game the entire sub-view layer, the data layer, service layer three-layer struct

  • [Transfer] flash embedded fonts Experience 2011-05-18

    http://bbs.9ria.com/viewthread.php?tid=83364&extra=page% 3D1% 26amp% 3Borderby% 3Ddateline% 26amp% 3Bfilter% 3D2592000 For some reason today to learn the application of flash embedded fonts, read many articles online, after several attempts finally s

  • Flash exchange experience in Guangzhou 2010-07-24

    Guangzhou has a exchange, play a sauce. Their own limited knowledge of the flash, but would like to write a source of online games to play, so school for some time. Aware of this exchange, we signed up. After listening to the afternoon, feeling prett

  • [Transfer] flash builder 4 compiler parameters 2010-10-19

    http://keren.javaeye.com/blog/763322 accessible = true | false whether the intelligibility (eg, to facilitate the performance of persons with disabilities) actionscript-file-encoding | encoding settings file, such as Shitf_JIS advanced | mxmlc-help a

  • Transfer: step-by-step WEB bulk upload multiple files (swfupload) the perfect solution 2010-12-01

    ★ ★ ★ switched: "http://stephen830.javaeye.com/blog/255010" ★ ★ ★ I like the practical things, things that do not like the theory, in particular, an increasing number of new concepts is not very cold. Therefore, my article is primarily practical

  • Method of embedding Flash web discussion 2010-12-26

    Flash Embedded Forum, someone asked many times, in the end should be how to use, why not pass validation, to verify how to do so by such. Discussion, there have been many misunderstandings, so I open a single quote to sum up what I know, do not want