//Flash MX builtin functions and properties setupscript // //Casper Schuirink function MovieClip () { } function LoadVars () { } function XMLSocket () { } function AsBroadcaster () { } function Color (target) { this.target = target; ASSetPropFlags(this, null, 7); } function NetConnection () { this.isConnected = false; ASSetPropFlags(this, null, 7); ASnative(2100, 200)(this); } function NetStream (connection) { function OnCreate (nStream) { this.nStream = nStream; } ASnative(2101, 200)(this, connection); var o = OnCreate.prototype; o.onResult = function (streamId) { ASnative(2101, 201)(this.nStream, streamId); }; o.onStatus = function (info) { this.nStream.onStatus(info); }; connection.call("createStream", new onCreate (this)); } function Camera () { } function Microphone () { } function SharedObject () { } function LocalConnection () { } ASSetPropFlags = ASnative(1, 0); ASSetNative = ASnative(4, 0); escape = ASnative(100, 0); unescape = ASnative(100, 1); parseInt = ASnative(100, 2); parseFloat = ASnative(100, 3); trace = ASnative(100, 4); updateAfterEvent = ASnative(9, 0); isNaN = ASnative(200, 18); isFinite = ASnative(200, 19); setInterval = ASnative(250, 0); clearInterval = ASnative(250, 1); var o = Object.prototype; ASSetNative(o, 101, "6watch,6unwatch,6addProperty,valueOf,toString,6hasOwnProperty,6isPrototypeOf,6isPropertyEnumerable"); o.toLocaleString = function () { return (this.toString()); }; Object.registerClass = ASnative(101, 8); ASSetPropFlags(o, null, 3); ASSetPropFlags(Object, null, 7); var o = Function.prototype; ASSetNative(o, 101, "6call,6apply", 10); ASSetPropFlags(o, null, 3); Number = ASconstructor(106, 2); var o = Number.prototype; ASSetNative(o, 106, "valueOf,toString"); ASSetPropFlags(o, null, 3); var o = Number; o.NaN = NaN; o.POSITIVE_INFINITY = Infinity; o.NEGATIVE_INFINITY = -Infinity; o.MIN_VALUE = 4.94065645841247E-324; o.MAX_VALUE = 1.79769313486232E308; ASSetPropFlags(o, null, 7); Boolean = ASconstructor(107, 2); var o = Boolean.prototype; ASSetNative(o, 107, "valueOf,toString"); ASSetPropFlags(o, null, 3); Date = ASconstructor(103, 256); var o = Date.prototype; ASSetNative(o, 103, "getFullYear,getYear,getMonth,getDate,getDay,getHours,getMinutes,getSeconds,getMilliseconds,setFullYear,setMonth,setDate,setHours,setMinutes,setSeconds,setMilliseconds,getTime,setTime,getTimezoneOffset,toString,setYear"); ASSetNative(o, 103, "getUTCFullYear,getUTCYear,getUTCMonth,getUTCDate,getUTCDay,getUTCHours,getUTCMinutes,getUTCSeconds,getUTCMilliseconds,setUTCFullYear,setUTCMonth,setUTCDate,setUTCHours,setUTCMinutes,setUTCSeconds,setUTCMilliseconds", 128); o.valueOf = o.getTime; Date.UTC = ASnative(103, 257); ASSetPropFlags(o, null, 3); ASSetPropFlags(Date, null, 7); String = ASconstructor(251, 0); var o = String.prototype; ASSetNative(o, 251, "valueOf,toString,toUpperCase,toLowerCase,charAt,charCodeAt,concat,indexOf,lastIndexOf,slice,substring,split,substr", 1); String.fromCharCode = ASnative(251, 14); ASSetPropFlags(o, null, 3); ASSetPropFlags(String, null, 3); Array = ASconstructor(252, 0); var o = Array.prototype; ASSetNative(o, 252, "push,pop,concat,shift,unshift,slice,join,splice,toString,sort,reverse,sortOn", 1); ASSetPropFlags(o, null, 3); Math = {E:2.71828182845905, LN10:2.30258509299405, LN2:0.693147180559945, LOG10E:0.434294481903252, LOG2E:1.44269504088896, PI:3.14159265358979, SQRT1_2:0.707106781186548, SQRT2:1.4142135623731}; ASSetNative(Math, 200, "abs,min,max,sin,cos,atan2,tan,exp,log,sqrt,round,random,floor,ceil,atan,asin,acos,pow"); ASSetPropFlags(Math, null, 7); Sound = ASconstructor(500, 16); var o = Sound.prototype; ASSetNative(o, 500, "getPan,getTransform,getVolume,setPan,setTransform,setVolume,stop,attachSound,start,6getDuration,6setDuration,6getPosition,6setPosition,6loadSound,6getBytesLoaded,6getBytesTotal"); ASSetPropFlags(o, null, 7); var o = MovieClip.prototype; o.useHandCursor = true; o.enabled = true; o.addProperty("tabIndex", ASnative(900, 200), ASnative(900, 201)); o.meth = function (method) { method = method.toLowerCase(); if (method == "get") { return (1); } else if (method == "post") { return (2); } return (0); }; o.getURL = function (url, window, method) { if (typeof (window) == "undefined") { window = ""; } var t = this.meth(method); tellTarget (this._target) { if (t == 0) { getURL (url, window); } else if (t == 1) { getURL (url, window, "GET"); } else { getURL (url, window, "POST"); } }; }; o.unloadMovie = function () { unloadMovie (this._target); }; o.loadVariables = function (url, method) { var t = this.meth(method); tellTarget (this._target) { if (t == 0) { loadVariables (url, _target); } else if (t == 1) { loadVariables (url, _target, "GET"); } else { loadVariables (url, _target, "POST"); } }; }; o.loadMovie = function (url, method) { var t = this.meth(method); tellTarget (this._target) { if (t == 0) { loadMovie (url, _target); } else if (t == 1) { loadMovie (url, _target, "GET"); } else { loadMovie (url, _target, "POST"); } }; }; ASSetNative(o, 900, "attachMovie,swapDepths,localToGlobal,globalToLocal,hitTest,getBounds,getBytesTotal,getBytesLoaded,6attachAudio,6attachVideo,6getDepth,6setMask,play,stop,nextFrame,prevFrame,gotoAndPlay,gotoAndStop,duplicateMovieClip,removeMovieClip,startDrag,stopDrag"); ASSetNative(o, 901, "6createEmptyMovieClip,6beginFill,6beginGradientFill,6moveTo,6lineTo,6curveTo,6lineStyle,6endFill,6clear"); o.createTextField = ASnative(104, 200); ASSetPropFlags(o, null, 3); XMLNode = ASconstructor(253, 0); var o = XMLNode.prototype; ASSetNative(o, 253, "cloneNode,removeNode,insertBefore,appendChild,hasChildNodes,toString", 1); XML = ASconstructor(253, 7); XML.prototype = new XMLNode (1, ""); var o = XML.prototype; ASSetNative(o, 253, "createElement,createTextNode,parseXML", 8); o.load = ASnative(301, 0); o.send = ASnative(301, 1); o.sendAndLoad = ASnative(301, 2); o.onLoad = function () { }; o.onData = function (src) { if (src == null) { this.onLoad(false); } else { this.parseXML(src); this.loaded = true; this.onLoad(true); } }; o.getBytesLoaded = function () { return (this._bytesLoaded); }; o.getBytesTotal = function () { return (this._bytesTotal); }; var o = LoadVars.prototype; ASSetNative(o, 301, "load,send,sendAndLoad,decode"); o.getBytesLoaded = function () { return (this._bytesLoaded); }; o.getBytesTotal = function () { return (this._bytesTotal); }; o.toString = function () { var a = []; for (var x in this) { a.push((escape(x) + "=") + escape(this[x])); } return (a.join("&")); }; o.contentType = "application/x-www-form-urlencoded"; o.onLoad = function () { }; o.onData = function (src) { if (src == null) { this.onLoad(false); } else { this.decode(src); this.loaded = true; this.onLoad(true); } }; ASSetPropFlags(o, null, 131); var o = XMLSocket.prototype; ASSetNative(o, 400, "connect,send,close"); o.onData = function (src) { this.onXML(new XML (src)); }; ASSetPropFlags(o, null, 3); var o = AsBroadcaster; o.broadcastMessage = ASnative(101, 12); o.addListener = function (x) { this.removeListener(x); this._listeners.push(x); return (true); }; o.removeListener = function (x) { var a = this._listeners; var i = 0; while (i < a.length) { if (a[i] == x) { a.splice(i, 1); return (true); } i++; } return (false); }; o.initialize = function (o) { o.broadcastMessage = ASnative(101, 12); o.addListener = AsBroadcaster.addListener; o.removeListener = AsBroadcaster.removeListener; o._listeners = []; AsSetPropFlags(o, "broadcastMessage,addListener,removeListener,_listeners", 131); }; ASSetPropFlags(o, null, 131); Selection = {}; ASSetNative(Selection, 600, "getBeginIndex,getEndIndex,getCaretIndex,getFocus,setFocus,setSelection"); AsBroadcaster.initialize(Selection); ASSetPropFlags(Selection, null, 7); var o = Color.prototype; ASSetNative(o, 700, "setRGB,setTransform,getRGB,getTransform"); ASSetPropFlags(o, null, 7); Mouse = {}; ASSetNative(Mouse, 5, "show,hide"); AsBroadcaster.initialize(Mouse); ASSetPropFlags(Mouse, null, 7); Key = {ALT:18, ENTER:13, SPACE:32, UP:38, DOWN:40, LEFT:37, RIGHT:39, PGUP:33, PGDN:34, HOME:36, END:35, TAB:9, CONTROL:17, SHIFT:16, ESCAPE:27, INSERT:45, DELETEKEY:46, BACKSPACE:8, CAPSLOCK:20}; ASSetNative(Key, 800, "getAscii,getCode,isDown,isToggled"); AsBroadcaster.initialize(Key); ASSetPropFlags(Key, null, 7); Button = ASconstructor(105, 0); var o = Button.prototype; o.useHandCursor = true; o.enabled = true; o.getDepth = ASnative(105, 3); TextField = ASconstructor(104, 0); var o = TextField.prototype; ASSetNative(o, 104, "6replaceSel,6getTextFormat,6setTextFormat,6removeTextField,6getNewTextFormat,6setNewTextFormat,6getDepth", 100); AsBroadcaster.initialize(o); ASSetPropFlags(o, null, 131); TextField.getFontList = ASnative(104, 201); ASSetPropFlags(TextField, null, 131); TextFormat = ASconstructor(110, 0); Stage = {width:0, height:0, scaleMode:0, align:""}; Stage.addProperty("scaleMode", ASnative(666, 1), ASnative(666, 2)); Stage.addProperty("align", ASnative(666, 3), ASnative(666, 4)); Stage.addProperty("width", ASnative(666, 5), ASnative(666, 6)); Stage.addProperty("height", ASnative(666, 7), ASnative(666, 8)); Stage.addProperty("showMenu", ASnative(666, 9), ASnative(666, 10)); AsBroadcaster.initialize(Stage); Video = ASconstructor(667, 0); var o = Video.prototype; ASSetNative(o, 667, "6attachVideo,6clear", 1); ASSetPropFlags(o, null, 3); Accessibility = {}; ASSetNative(Accessibility, 1999, "6IsActive,6SendEvent"); ASSetPropFlags(Accessibility, null, 6); var o = NetConnection.prototype; ASSetNative(o, 2100, "6connect,6close,6call,6addheader"); ASSetPropFlags(o, null, 3); var o = NetStream.prototype; o.publish = function (name, type) { var args = arguments.length; if (args == 1) { ASnative(2101, 202)(this, "publish", null, name); } else { ASnative(2101, 202)(this, "publish", null, name, type); } }; o.play = function (name, start, len, reset) { var args = arguments.length; if (args == 1) { ASnative(2101, 202)(this, "play", null, name); } else if (args == 2) { ASnative(2101, 202)(this, "play", null, name, start * 1000); } else if (args == 3) { ASnative(2101, 202)(this, "play", null, name, start * 1000, len * 1000); } else { ASnative(2101, 202)(this, "play", null, name, start * 1000, len * 1000, reset); } }; o.receiveAudio = function (flag) { ASnative(2101, 202)(this, "receiveAudio", null, flag); }; o.receiveVideo = function (flag) { ASnative(2101, 202)(this, "receiveVideo", null, flag); }; o.pause = function (flag) { ASnative(2101, 202)(this, "pause", null, flag, this.time * 1000); }; o.seek = function (offset) { ASnative(2101, 202)(this, "seek", null, offset * 1000); }; ASSetNative(o, 2101, "6close,6attachAudio,6attachVideo,6send,6setBufferTime"); ASSetPropFlags(o, null, 3); Camera.get = function (index) { return (ASnative(2102, 200)(index)); }; Camera.addProperty("names", ASnative(2102, 201), null); var o = Camera.prototype; ASSetNative(o, 2102, "6setMode,6setQuality,6setKeyFrameInterval,6setMotionLevel,6setLoopback"); ASSetPropFlags(o, null, 3); Microphone.get = function (index) { return (ASnative(2104, 200)(index)); }; Microphone.addProperty("names", ASnative(2104, 201), null); var o = Microphone.prototype; ASSetNative(o, 2104, "6setSilenceLevel,6setRate,6setGain,6setUseEchoSuppression"); ASSetPropFlags(o, null, 3); SharedObject.getLocal = function (name, localPath) { var result = ASnative(2106, 202)(name, localPath); if (!result) { result = new SharedObject (); if (!ASnative(2106, 204)(result, name, localPath)) { return (null); } } return (result); }; SharedObject.getRemote = function (name, remotePath, options) { var result = ASnative(2106, 203)(name, remotePath, options); if (!result) { result = new SharedObject (); if (!ASnative(2106, 205)(result, name, remotePath, options)) { return (null); } } return (result); }; SharedObject.deleteAll = function (url) { return (ASnative(2106, 206)(url)); }; SharedObject.getDiskUsage = function (url) { return (ASnative(2106, 207)(url)); }; ASSetPropFlags(SharedObject, "deleteAll,getDiskUsage", 1); var o = SharedObject.prototype; ASSetNative(o, 2106, "6connect,6send,6flush,6close,6getSize,6setFps"); ASSetPropFlags(o, null, 3); System = {}; System.Capabilities = {hasAudio:true, hasMP3:true, hasAudio:true, hasMP3:true, hasAudioEncoder:true, hasVideoEncoder:true, screenResolutionX:800, screenResolutionY:600, screenDPI:72, screenColor:"color", pixelAspectRatio:1, hasAccessibility:true, Query:ASnative(11, 0)}; System.Capabilities.Query(); delete System.Capabilities.Query; System.Product = function (strName) { this.name = strName; ASSetPropFlags(this, null, 7); }; var o = System.Product.prototype; o.IsRunning = function () { return (ASnative(2201, 0)(this.name)); }; o.IsInstalled = function () { return (ASnative(2201, 1)(this.name)); }; o.Launch = function () { return (ASnative(2201, 2)(this.name)); }; o.Download = function () { if (arguments.length > 0) { return (ASnative(2201, 3)(this, this.name, arguments[0])); } else { return (ASnative(2201, 3)(this, this.name)); } }; ASSetPropFlags(o, null, 3); System.ShowSettings = ASnative(2107, 0); System.security = {allowDomain:ASnative(12, 0)}; var o = LocalConnection.prototype; ASSetNative(o, 2200, "6connect,6send,6close,6domain"); ASSetPropFlags(o, null, 3); ASSetPropFlags(_global, "setInterval,clearInterval,LoadVars,NetConnection,NetStream,SharedObject,TextField,TextFormat,Stage,Video,Accessibility,Camera,Microphone,System,LocalConnection,Button", 128); Cookie = {}; Cookie.getCookie = function () { var obj = new XML (); obj.load(ASnative(302, 0)()); return (obj); }; ASSetNative(Cookie, 302, "setCookie", 1); ASSetPropFlags(Cookie, null, 7); MMSave = ASnative(10, 0); CustomActions = {}; ASSetNative(CustomActions, 303, "install,uninstall,list,get"); ASSetPropFlags(CustomActions, null, 7); ASSetPropFlags(_global, "CustomActions", 128);