📄 core_setup.as
字号:
/*
Core Setup v1.1
Oct. 29, 2002
(c) 2002 Robert Penner
Object.superCon()
Function.extend()
MovieClip.addListener()
onEnterFrame event broadcasting
Dependencies:
- ASBroadcaster (undocumented feature of Flash MX)
- ASSetPropFlags (undocumented feature of Flash 5+)
Discussed in Chapters 2 and 6 of
Robert Penner's Programming Macromedia Flash MX
Used by Motion, Tween, PhysicsParticle, ElasticForce, and other classes
http://www.robertpenner.com/profmx
http://www.amazon.com/exec/obidos/ASIN/0072223561/robertpennerc-20
*/
// call superclass constructor
// usage: function Child () { this.superCon (arg1, arg2...); }
Object.prototype.superCon = function () {
arguments.caller.prototype.__proto__.constructor.apply (this, arguments);
};
ASSetPropFlags (Object.prototype, null, 1);
// inherit from a superclass
// usage: Child.extend (Parent);
Function.prototype.extend = function (superclass) {
this.prototype.__proto__ = superclass.prototype;
};
ASSetPropFlags (Function.prototype, null, 1);
// set up MovieClip.addListener() if it doesn't exist
// and create an empty clip to broadcast onEnterFrame events
if (typeof MovieClip.addListener != 'function') {
ASBroadcaster.initialize (MovieClip);
var mc = _level0.createEmptyMovieClip ("$enterframe_source", 9876);
mc.onEnterFrame = function () { MovieClip.broadcastMessage ("onEnterFrame") };
delete mc;
}
trace (">> core setup loaded");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -