What is the best technique for getting at the source code for internal AS3 methods? I'm trying to learn more about DisplayObjectContainer.constructChildren() - is it pri开发者_开发技巧vate? is it protected? can I extend it?
Does such a source view of internal AS3 code exist?
you can try decompiling the playerglobal.swc
. even though it's not always easy to tell what's going on in a decompiled class file (and nearly impossible if the code is obfuscated) you should be able to get an idea of what's happening.
- duplicate then rename
playerglobal.swc
toplayerglobal.zip
and unzip it.- decompile the
library.swf
file found within the unzipped archive.
you can use one of several commercial Flash decompilers available on the internet. the one i sometimes use for this purpose is Trillix since the free demo will still allow you to read the source files (but you won't be able to highlight/copy the code).
Can't tell you about viewing the source, but constructChildren
is not available for override. The following gives an error in FDT because it cannot see a corresponding method in the superclass:
package {
import flash.display.DisplayObjectContainer;
public class Test extends DisplayObjectContainer {
public function Test():void
{
}
override protected function constructChildren():void
{
}
}
}
精彩评论