Betray the timeline • Break the IDE

Source: Internet
Author: User
Tags contains

First of all I want to make it clear that this headline is really exaggerated. I just hope that this exaggeration will arouse your reluctance to pay attention to the flashers of ActionScript.

In fact, every flasher, especially experienced Flash4, Flash5 of this group of people, are perennial through the practice of weeks deployment of the work interface. including myself, the time axis of familiarity has undergone a relatively long process. In this process, I also distance the idea of flash closer and nearer.

Let's talk about the concept of the IDE, I believe that for an interface or animation designer, the IDE is a very unfamiliar noun. In fact, the flash we use every day is an IDE environment. I am here to more accurately cite the following concepts, I believe that after reading the IDE is no longer unfamiliar word:

Referencing wikilib.com
The integrated development environment (integrated Development environment, the IDE), also known as an integrated programming environment or visual development environment, is software designed to facilitate development by software developers, typically for a programming language, Most are interface-friendly visualization environments that generally integrate the source editor, debugger, compiler, and resource editor.
Obviously, the timeline is part of the IDE, but I would prefer to separate the timeline to emphasize, or even moderately exaggerate, criticism. Because sometimes the timeline is really bulky. If you're not a master-per-frame animator, but a designer who develops flash applications (especially games), I think the characteristics of the timeline in many cases seem awkward. For example, Motiontween looks like there are only two keyframes, but in fact the gradient frames are all about the size of the file.

In addition, there are many situations where we need to dynamically manage the elements on some scenes. If use the time axis, I think I am afraid can only use the most soil gotoandplay, gotoandstop with the use. Of course, in the Flash4, Flash5 era, did create a group of top experts, they only use gotoAndPlay to complete the task, these people have rigorous logical thinking ability and excellent mentality. However, in the MX era, especially in the mx2k4 era, as the leap in development, leading to this kind of genius design pattern is reduced to a rash!

The emergence of Attachmovie in Flash5 is undoubtedly a revolutionary development. Unfortunately at that time, there are not many people with Attachmovie, because compared to the time axis, it is really very troublesome. Because the project needs at that time and now different, the timeline effect is still the mainstream development tool.

The biggest revolution of the MX era I was most impressed with is actually the IDE. Flash5 in the stupid panel to MX became so well-behaved obedient. The arrival of the MX era led to a flash production storm, and more and more people (mainly animated) joined the flasher team. Unfortunately later Mx2k4 and 8 changed the interface, in fact, I personally like the IDE interface design MX! (I don't know if I will launch a retro version of Ideskin)

The introduction of MX and MX2K4, make as more standard, the change of project requirement, cause the effect of the time axis becomes more and more stretched. More people are starting to move into dynamic deployment scenarios, but it is worth mentioning that some of the older generation of flash designers still do not seem to be moving, MM launched the time axis effect is a major failure of MX2K4. Of course afterward, AS2.0 to Mx2k4 to give unlimited light, this time emerged a large number of as-coder, uneven level, no matter what, this is another revolution!

In this era, the demand for projects has changed, and more and more complex applications are being done through flash, but instead of killing an Ajax halfway through, I suspect that JavaScript is really going to be overshadowed by ActionScript. My own 56 graffiti is also done by using MX2K4.

Now to 8, although as there is no substantial change, but the project needs to increase again, the timeline can not be deployed independently of a good application. More people began to pay attention to ActionScript, and began to pay attention to attachmovie such a once by us for "trouble" and reject the statement.

Do not want to be too pure discussion technology, so sent some of the above nonsense, now or simply introduce some Attachmovie bar.

First of all, to understand the basic principles of flash. The content of the SWF file is undoubtedly mainly from the library, this concept is not unfamiliar to everyone (is the library). The library contains all the components referenced by the timeline, and of course _root is also a MC component, and it also includes all the scattered graphics in the IDE. The rest is the component that contains the linkage ID in the library. These components are the most important objects of Attachmovie's operation!

Don't want to emphasize too much theoretical knowledge, because these content can be found in the Help document. I would like to combine my own development experience to talk about:

First of all, attach content, try not to attach to _root under. Because the original is to be dynamic management of MC, if exclusively put under _root, will lead to classification is not clear, it is difficult to efficiently dispatch, management MC. I suggest that a MC be built dynamically under the _root. For example, you have a game, to prevent opponents and friendlies, it may be necessary to establish two MC container "NPC_MC" "ENEMY_MC", and then to the two MC attache:

var npc:movieclip = _root.createemptymovieclip ("NPC_MC", 1);
var emy:movieclip = _root.createemptymovieclip ("ENEMY_MC", 2);
for (Var i=0;i<imax;i++)
Npc.attachmovie (...);
for (Var j=0;j<jmax;j++)
Emy.attachmovie (...);

Secondly, because it is the dynamic establishment of MC, many times we have no time to manage the depth, Macromedia Flash 2k4 has provided a very important method: Getnexthightestdepth (), this method can find the current MC in the deepest depth, Then return with the number type.

As a result, we often see some "modular layout" code after the 2K4 version:

Within a cycle
var d:number = this.getnexthighestdepth ();
This.attachmovie ("Somelibstr", "MYMC" +d,d);
Within a cycle

Clearly, the code is easy to understand, very suitable for dynamic deployment of a large number of MC (with the cycle)

Delete Dynamically is removemovieclip, this statement is very simple, do not repeat.

Finally, sort out some common problems:

1, the connection name in the library is wrong
2, since the name has not changed with the level of change, strongly recommended a noun + depth to name.
3, the depth serial number is not defined, resulting in MC pointing undefined
4, the Mother MC is not defined (this is easy to appear with function)

All of these problems can be found by trace, so just be patient and have a little patience.

Finally, I wish you a smooth break through the IDE, breaking the timeline limit!



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.