![]() ![]() An example is how Flash handles rotation, ActionScript is the only language that I know of that has a rotation range 0 to 180 then -180 to -1. There are other areas where Flash blatantly breaks the norm. In ActionScript 3.0 Flash 9, they corrected this mistake and used the standard range 0.0 to 1.0 however, they managed to forget to change this for gradients, which still use the 0 to 100 range for alpha values, Flash 10 corrected the oversight. ![]() For example, in ActionScript 2.0 the alpha property on an object was in the range 0 to 100, somewhere I remember reading that they thought it would be easier for designers that were programming. There are some instances where Flash has already shown improvement in this regard. There are certain design choices in ActionScript that should be more consistent internally and changed to what has become standard in graphics suites. I doubt Adobe will ever release Flash’s source code, so improved documentation is a necessity. ![]() Unless you have done a significant amount of benchmarking rooting out performance bugs is a guessing game. The other painful aspect of working with closed source code is that there is only a general idea about the performance of different functions. This kind of imperfection is exactly what needs to be documented the most. If the object is moved, re-parented, or added back on the stage you would need to know where the object was the last time it was drawn, which surprisingly includes if the object is still on the stage and was drawn into a BitmapData object. The x and y parameters specify a point in the coordinate space of the Stage, not the display object container that contains the display object (unless that display object container is the Stage).” What Adobe fails to tell us is that hitTestPoint only evaluates at the last place that the object was drawn. Case in point, hitTestPoint “Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters. ![]() My criticisms are when critical information is completely left out. Typically, the documentation is clear and straightforward and only few instances where the documentation says one thing and ActionScript does another. Flash did do some things right in there documentation, I greatly appreciate all of the examples, there is good use of imagery on pages referring to graphics, and the show / hide functionality of inherited methods, properties, and events keeps pages clean and topic focused. I am not the first person to find several flaws in Flash’s ActionScript language reference. However, if your source is closed the community generally expects that your documentation is flawless. I understand both sides of the open source controversy, having developed proprietary software I can relate to a closed source policy. Adobe needs to respond to the needs of game developers. Flash is not marketed as a game engine so it is unfair to be overly critical however, there is a Flash game development community and it continues to grow. More specific to game development, Flash lacks an acceptable collision system, profiling tools, and other typical features like a particle system and physics classes found in other game development suites. Some of the setbacks that Flash game developers suffer from are communal to all Flash developers: having to wrestle with the Flash editor, coping with the rudimentary UI components, and not having access to ActionScript’s source code. In fact, there is an entire micro economy providing support for things Adobe left out. Try setting it to true on your text field, and all of the above may be redundant. 如果要保留选择,还可以在使用tSelection()方法设置颜色后重置它。ĮDIT: Note that if the selection is just hidden, maybe what you're after is simply TextField.alwaysShowSelection. If you want to keep the selection, you can also reset it after the color has been set using the tSelection() method. When the user selects a color, use the setTextFormat() to change the color, passing in the stored start and end indices. Then get the selectionBeginIndex and selectionEndIndex from the text field before that happens, and store it in a persistant (e.g. could it be the click on the color picker component?). Figure out what it is that causes your text field selection to be lost (e.g. ![]()
0 Comments
Leave a Reply. |