ActionScript some "unknown" skills
This article used to collect some specialized ActionScript unknown, or is not uncommon for a number of skills or issues. We would like to help!
This article, I will be constantly updated and amended.
1. TextFormat.URL
Many people have noted that the use of textField.htmlText to write hypertext approach, but it seems that very few people know that fact, we can also use TextFormat.URL to define.
1: myFormat = new TextFormat ();
2: myFormat.url = "http://www.zhitiao.com";
3: my_txt.html = true; / / This is necessary
4: my_txt.htmlText = "a note studio";
5: my_txt.setTextFormat (myFormat);
2. Use Javascript method usually trace method browser can use alternative methods
1: function debug (info) (
2: getUrl ( "javascript: alert ( '" info "')");
3:)
If the use of hyperlinks, you can directly use
My_txt.html = true;
My_txt.htmlText = "<a href=javascript:alert('æ¬¢è¿Žå…‰ä¸´ä¸€å¼ çº¸æ¡å·¥ä½œå®¤!')> a note studio </ a>";
3. Replication array If you use the following method of reproduction array is a point, there is no genuine copy.
[Copy] [Run] [Save]
1: b_array = a_array;
2: / / a_array array of content change, b_array the contents of the changing
3: / / solutions can use the following method
4: b_array = a_array.slice ();
4. Unloading into the arena MC
We know that the only dynamic created mc can use removeMovieClip () method to offload to help in removeMovieClip method described as follows:
Quote
DuplicateMovieClip used to delete (), MovieClip.duplicateMovieClip () or
MovieClip.attachMovie () to create a video clip examples.
Below skills will enable us to fuel you need to uninstall the MC, even if you dragged into the arena of components.
1: My_mc.swapDepths (100); / / mc the depth of the value set for the value of greater than 0
2: My_mc.removeMovieClip ();// This can be a normal uninstall mc oh is not very useful.
PS: Use my_mc.unloadMovie () can be deleted mc examples, but retained examples attribute processing and editing functions. By removeMovieClip () can be deleted examples (including its handling properties and editing functions).
5. Magic depth -16384
We know that the use of Flash elements in the concept of depth, all the elements are created from -16383, so if we are to a certain elements appear at the bottom of the case, the depth can be set for the magic depth.
We may wish to investigate the reasons for under:
Macromedia's mx.managers.DepthManager original definition of the category in the following values:
[Copy] [Run] [Save]
1: / / highest allowed depth is reserved for tooltips and cursors
2: static var reservedDepth: Number = 1048575;
3: / / highest depth for all other objects
4: static var highestDepth: Number = 1048574;
5: / / lowest allowed depth
6: static var lowestDepth: Number = -16383;
7: / / lowest depth plus this number of layers is reserved
8: / / for statically placed content
9: static var numberOfAuthortimeLayers: Number = 383;
Tags: div skills






Leave a Reply