ActionScript Map v1.01




This is an attempt to build a map of the built-in top-level objects/function objects of MX ActionScript from an OOP point of view. The test code below proves that the relationships among them should be as shown in this map.

There are two types of relationship in the map. One is a constructor-instance relationship which is indicated by a solid line on the map, and the other is a SuperClass-SubClass relationship which is indicated by a broken line with an arrow.

The other top-level functions such as 'eval' and 'escape', which are only used as just 'functions', are not included in this map.

 


Test code (All output true.)

//Built-in function objects
trace(Object.constructor == Function);
trace(MovieClip.constructor == Function);
trace(Array.constructor == Function);
trace(Boolean.constructor == Function);
trace(Color.constructor == Function);
trace(Date.constructor == Function);
trace(Number.constructor == Function);
trace(Sound.constructor == Function);
trace(String.constructor == Function);
trace(XMLNode.constructor == Function);
trace(XML.constructor == Function);
trace(XMLSocket.constructor == Function);
trace(Button.constructor == Function);
trace(LoadVars.constructor == Function);
trace(TextField.constructor == Function);
trace(TextFormat.constructor == Function);

//User-defined functions are also instances of Function.
myFunction = function () { };
trace(myFunction.constructor == Function);

//They inherit from the Object class
trace(Function.prototype.__proto__ == Object.prototype);
trace(MovieClip.prototype.__proto__ == Object.prototype);
trace(Array.prototype.__proto__ == Object.prototype);
trace(Boolean.prototype.__proto__ == Object.prototype);
trace(Color.prototype.__proto__ == Object.prototype);
trace(Date.prototype.__proto__ == Object.prototype);
trace(Number.prototype.__proto__ == Object.prototype);
trace(Sound.prototype.__proto__ == Object.prototype);
trace(String.prototype.__proto__ == Object.prototype);
trace(XMLNode.prototype.__proto__ == Object.prototype);
trace(XML.prototype.__proto__ == XMLNode.prototype);
trace(XMLSocket.prototype.__proto__ == Object.prototype);
trace(Button.prototype.__proto__ == Object.prototype);
trace(LoadVars.prototype.__proto__ == Object.prototype);
trace(TextField.prototype.__proto__ == Object.prototype);
trace(TextFormat.prototype.__proto__ == Object.prototype);
trace(myFunction.prototype.__proto__ == Object.prototype);

//Built-in objects
trace(Key.constructor == Object);
trace(Math.constructor == Object);
trace(Mouse.constructor == Object);
trace(Selection.constructor == Object);
trace(Accessibility.constructor == Object);
trace(CustomActions.constructor == Object);
trace(Stage.constructor == Object);
trace(System.constructor == Object);
trace(System.Capabilities.constructor == Object);
trace(CustomActions.constructor == Object);
trace(Stage.constructor == Object);
trace(System.constructor == Object);
trace(System.Capabilities.constructor == Object);

//with Remoting extension
#include "DataGlue.as"
#include "NetDebug.as"
#include "NetServices.as"
trace(NetServices.constructor == Object);
trace(NetConnection.prototype.__proto__ == Object.prototype);
trace(DataGlue.prototype.__proto__ == Object.prototype);
trace(NetDebug.prototype.__proto__ == Object.prototype);
trace(NetDebugConfig.prototype.__proto__ == Object.prototype);
trace(RecordSet.prototype.__proto__ == RsDataProviderClass.prototype);

//Remoting Internal
trace(RsDataProviderClass.prototype.__proto__ == Object.prototype);
trace(RsDataFetcher.prototype.__proto__ == Object.prototype);
trace(NetServiceProxy.prototype.__proto__ == Object.prototype);
trace(NetServiceProxyResponder.prototype.__proto__ == Object.prototype);

//with Flash Communication Server
trace(Camera.prototype.__proto__ == Object.prototype);
trace(LocalConnection.prototype.__proto__ == Object.prototype);
trace(Microphone.prototype.__proto__ == Object.prototype);
trace(NetStream.prototype.__proto__ == Object.prototype);
trace(SharedObject.prototype.__proto__ == Object.prototype);
trace(Video.prototype.__proto__ == Object.prototype);


Back to Flash Home

Copyright©2000-2002 STUDIO FIRST RAYS. All rights reserved