It is always fun when you come across an undocumented feature, especially when it sounds to be extremely useful. One “known” undocumented feature within ActionScript 3.0 is the ability to add ActionScript to frames of a MovieClip via runtime.
There could be many uses for this feature. One popular use could be adding a stop() action to MovieClips. Since many Flash Developers love keeping the timeline as clean as all can be, this feature, when treated wisely, is like gold.
Implementing this feature
Implementing this feature is pretty self-explanatory. As long as you have a MovieClip created at runtime, dynamically or timeline, simply add the the following code within an external .as file of its own. This method allows for an unlimited amount of framenumber, function parameter groupings.
movieclip.addFrameScript(framenumber, function, framenumber, function...etc);
Some might find this “undocumented feature” useful, some might not. Whatever the case may be, keep in mind that this feature may or may not be supported in future versions of the Flash Player. Since the feature is considered “undocumented” be careful on using it in commercial projects – for the sake of future compatibility.
Have fun experimenting!
I am curious would any of you find this feature useful in future use?