/**
* Smokescreen v0.1.2 - Chris Smoak <chris.smoak@gmail.com>
* A Flash player written in JavaScript.
*
* Copyright 2010, RevShock
*
* Date: 2010-05-27
*/
var Smokescreen = function (url, element, width, height, name, params) {
goog = {};
goog.global = this;
goog.provide = function (a) {
a = a.split(".");
var b = goog.global;
for (var c in a) {
var d = a[c];
d in b || (b[d] = {});
b = b[d]
}
};
goog.require = function () {};
var fljs = {},
BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS"
},
searchString: function (a) {
for (var b = 0; b < a.length; b++) {
var c = a[b].string,
d = a[b].prop;
this.versionSearchString = a[b].versionSearch || a[b].identity;
if (c) {
if (c.indexOf(a[b].subString) != -1) return a[b].identity
} else if (d) return a[b].identity
}
},
searchVersion: function (a) {
var b = a.indexOf(this.versionSearchString);
if (b != -1) return parseFloat(a.substring(b + this.versionSearchString.length + 1))
},
dataBrowser: [{
string: navigator.userAgent,
subString: "Chrome",
identity: "Chrome"},{
string: navigator.vendor,
subString: "Apple",
identity: "Safari",
versionSearch: "Version"},{
prop: window.opera,
identity: "Opera"},{
string: navigator.userAgent,
subString: "Firefox",
identity: "Firefox"},{
string: navigator.userAgent,
subString: "MSIE",
identity: "Explorer",
versionSearch: "MSIE"}],
dataOS: [{
string: navigator.platform,
subString: "Win",
identity: "Windows"},{
string: navigator.userAgent,
subString: "iPad",
identity: "iPad"},{
string: navigator.userAgent,
subString: "iPhone",
identity: "iPhone"},{
string: navigator.platform,
subString: "Mac",
identity: "Mac"}]
};
BrowserDetect.init();
fljs.agent = BrowserDetect;
fljs.addConstants = function (a, b) {
for (var c in b) a[c] = b[c]
};
fljs.addMethods = function (a, b) {
for (var c in b) a.prototype[c] = b[c]
};
fljs.addStaticMethods = function (a, b) {
for (var c in b) a[c] = b[c]
};
fljs.addEvents = function (a, b) {
for (var c in b) {
var d = b[c],
e = d[0],
f = d[2];
a.prototype["__add" + e] = d[1];
a.prototype["__remove" + e] = f
}
};
fljs.now = function () {
return +new Date
};
fljs.inherits = function (a, b) {
function c() {}
c.prototype = b.prototype;
a.superClass_ = b.prototype;
a.prototype = new c;
a.prototype.constructor = a
};
fljs.base = function (a, b) {
var c = arguments.callee.caller;
if (c.superClass_) return c.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1));
for (var d = Array.prototype.slice.call(arguments, 2), e = false, f = a.constructor; f; f = f.superClass_ && f.superClass_.constructor) if (f.prototype[b] === c) e = true;
else if (e) return f.prototype[b].apply(a, d);
if (a[b] === c) return a.constructor.prototype[b].apply(a, d);
else throw Error("invalid base call");
};
fljs.bind = function (a, b) {
var c = b || this;
if (arguments.length > 2) {
var d = Array.prototype.slice.call(arguments, 2);
return function () {
var e = Array.prototype.slice.call(arguments);
Array.prototype.unshift.apply(e, d);
return a.apply(c, e)
}
} else return function () {
return a.apply(c, arguments)
}
};
fljs.DummyConsole = function () {};
fljs.addMethods(fljs.DummyConsole, {
info: function () {}
});
fljs.DummyConsole._instance = new fljs.DummyConsole;
fljs.console = function () {
return fljs.debug ? console : fljs.DummyConsole._instance
};
fljs.ext = {};
var flash = {};
flash.display = {};
flash.display.BlendMode = function () {};
fljs.addConstants(flash.display.BlendMode, {
ADD: "add",
ALPHA: "alpha",
DARKEN: "darken",
DIFFERENCE: "difference",
ERASE: "erase",
HARDLIGHT: "hardlight",
INVERT: "invert",
LAYER: "layer",
LIGHTEN: "lighten",
MULTIPLY: "multiply",
NORMAL: "normal",
OVERLAY: "overlay",
SCREEN: "screen",
SUBTRACT: "subtract"
});
flash.events = {};
flash.events.Event = function (a, b, c) {
this.type = a;
this.bubbles = b;
this.cancelable = c
};
fljs.addConstants(flash.events.Event, {
ACTIVATE: "activate",
ADDED: "added",
ADDED_TO_STAGE: "addedToStage",
CANCEL: "cancel",
CHANGE: "change",
CLOSE: "close",
COMPLETE: "complete",
CONNECT: "connect",
DEACTIVATE: "deactivate",
DISPLAYING: "displaying",
ENTER_FRAME: "enterFrame",
FULLSCREEN: "fullscreen",
ID3: "id3",
INIT: "init",
MOUSE_LEAVE: "mouseLeave",
OPEN: "open",
REMOVED: "removed",
REMOVED_FROM_STAGE: "removedFromStage",
RENDER: "render",
RESIZE: "resize",
SCROLL: "scroll",
SELECT: "select",
SOUND_COMPLETE: "soundComplete",
TAB_CHILDREN_CHANGE: "tabChildrenChange",
TAB_ENABLED_CHANGE: "tabEnabledChange",
TAB_INDEX_CHANGE: "tabIndexChange",
UNLOAD: "unload"
});
fljs.addMethods(flash.events.Event, {
clone: function () {},
formatToString: function (a) {
return "[" + a + this.buildPropertiesString_(arguments) + "]"
},
buildPropertiesString_: function (a) {
for (var b = [], c = 0; c < a.length; c++) c > 0 && b.push(a[c] + "=" + this[a[c]]);
return b.join(" ")
},
isDefaultPrevented: function () {
return this.returnValue_
},
stopImmediatePropagation: function () {
this.stopPropagation()
},
toString: function () {
return this.formatToString("Event", "type", "bubbles", "cancelable")
}
});
flash.events.MouseEvent = function (a, b, c, d, e, f, g, j, h, m, k, l, n, p) {
flash.events.Event.call(this, a, b, c);
this.localX = d;
this.localY = e;
this.relatedObject = f;
this.ctrlKey = g;
this.altKey = j;
this.shiftKey = h;
this.buttonDown = m;
this.delta = k;
this.commandKey = l;
this.controlKey = n;
this.clickCount = p
};
fljs.inherits(flash.events.MouseEvent, flash.events.Event);
fljs.addConstants(flash.events.MouseEvent, {
CLICK: "click",
DOUBLE_CLICK: "doubleClick",
MOUSE_DOWN: "mouseDown",
MOUSE_MOVE: "mouseMove",
MOUSE_OUT: "mouseOut",
MOUSE_OVER: "mouseOver",
MOUSE_UP: "mouseUp",
MOUSE_WHEEL: "mouseWheel",
ROLL_OUT: "rollOut",
ROLL_OVER: "rollOver"
});
flash.events.FullScreenEvent = function () {};
fljs.addConstants(flash.events.FullScreenEvent, {
FULL_SCREEN: "fullScreen"
});
flash.events.KeyboardEvent = function (a, b, c, d, e, f, g, j, h) {
flash.events.Event(a, b, c);
this.charCode = d;
this.keyCode = e;
this.keyLocation = f;
this.ctrlKey = g;
this.altKey = j;
this.shiftKey = h
};
fljs.inherits(flash.events.KeyboardEvent, flash.events.Event);
fljs.addConstants(flash.events.KeyboardEvent, {
KEY_DOWN: "keyDown",
KEY_UP: "keyUp"
});
flash.events.FocusEvent = function () {};
fljs.addConstants(flash.events.FocusEvent, {
KEY_FOCUS_CHANGE: "keyFocusChange",
MOUSE_FOCUS_CHANGE: "mouseFocusChange"
});
flash.events.IEventDispatcher = function () {};
fljs.addMethods(flash.events.IEventDispatcher, {
addEventListener: function () {},
dispatchEvent: function () {},
hasEventListener: function () {},
removeEventListener: function () {},
willTrigger: function () {}
});
flash.events.EventDispatcher = function () {
this._listenerCount = {};
this._listeners = {}
};
fljs.addMethods(flash.events.EventDispatcher, {
addEventListener: function (a, b, c, d, e) {
a in this._listeners || (this._listeners[a] = []);
this._listeners[a].push([b, c, d, e]);
if (!this._listenerCount[a]) {
this["__add" + a] && this["__add" + a]();
this._listenerCount[a] = 0
}
this._listenerCount[a] += 1
},
dispatchEvent: function (a) {
var b = this._listeners[a.type];
for (var c in b) b[c][0](a)
},
hasEventListener: function (a) {
return this._listeners[a] && this._listeners[a].length > 0
},
removeEventListener: function (a, b, c) {
var d = this._listeners[a];
for (var e in d) d[e][0] == b && d[e][1] == c && d.splice(e, 1);
this._listenerCount[a] -= 1;
if (!this._listenerCount[a]) {
this["__remove" + a] && this["__remove" + a]();
this._listenerCount[a] = 0
}
},
willTrigger: function (a) {
return this.hasEventListener(a)
}
});
flash.geom = {};
flash.geom.ColorTransform = function (a, b, c, d, e, f, g, j) {
if (typeof a == "undefined") a = 1;
if (typeof b == "undefined") b = 1;
if (typeof c == "undefined") c = 1;
if (typeof d == "undefined") d = 1;
if (typeof e == "undefined") e = 0;
if (typeof f == "undefined") f = 0;
if (typeof g == "undefined") g = 0;
if (typeof j == "undefined") j = 0;
this.alphaMultiplier = d;
this.alphaOffset = j;
this.blueMultiplier = c;
this.blueOffset = g;
this.greenMultiplier = b;
this.greenOffset = f;
this.redMultiplier = a;
this.redOffset = e;
this.__default = this.alphaMultiplier == 1 && this.blueMultiplier == 1 && this.greenMultiplier == 1 && this.redMultiplier == 1 && this.alphaOffset == 0 && this.blueOffset == 0 && this.greenOffset == 0 && this.redOffset == 0;
fljs.console("cxform")
};
fljs.addMethods(flash.geom.ColorTransform, {
concat: function (a) {
return new flash.geom.ColorTransform(this.redMultiplier * a.redMultiplier, this.greenMultiplier * a.greenMultiplier, this.blueMultiplier * a.blueMultiplier, this.alphaMultiplier * a.alphaMultiplier, Math.min(255, this.redOffset + a.redOffset), Math.min(255, this.greenOffset + a.greenOffset), Math.min(255, this.blueOffset + a.blueOffset), Math.min(255, this.alphaOffset + a.alphaOffset))
},
toString: function () {},
__toSvgString: function () {
return [this.redMultiplier, 0, 0, 0, this.redOffset, 0, this.greenMultiplier, 0, 0, this.greenOffset, 0, 0, this.blueMultiplier, 0, this.blueOffset, 0, 0, 0, this.alphaMultiplier, this.alphaOffset].toString()
}
});
flash.geom.ColorTransform.identity = new flash.geom.ColorTransform;
flash.geom.Matrix = function (a, b, c, d, e, f) {
if (typeof a == "undefined") a = 1;
if (typeof b == "undefined") b = 0;
if (typeof c == "undefined") c = 0;
if (typeof d == "undefined") d = 1;
if (typeof e == "undefined") e = 0;
if (typeof f == "undefined") f = 0;
this.a = a;
this.b = b;
this.c = c;
this.d = d;
this.tx = e;
this.ty = f;
this.__default = this.a == 1 && this.b == 0 && this.c == 0 && this.d == 1 && this.tx == 0 && this.ty == 0
};
fljs.addMethods(flash.geom.Matrix, {
clone: function () {
return new flash.geom.Matrix(this.a, this.b, this.c, this.d, this.tx, this.ty)
},
concat: function (a) {
var b = this.a * a.b + this.b * a.d,
c = this.c * a.a + this.d * a.c,
d = this.c * a.b + this.d * a.d,
e = this.tx * a.a + this.ty * a.c + a.tx,
f = this.tx * a.b + this.ty * a.d + a.ty;
this.a = this.a * a.a + this.b * a.c;
this.b = b;
this.c = c;
this.d = d;
this.tx = e;
this.ty = f
},
createBox: function () {},
createGradientBox: function () {},
deltaTransformPoint: function () {},
identity: function () {},
invert: function () {},
rotate: function () {},
scale: function (a, b) {
this.a *= a;
this.d *= b;
this.tx *= a;
this.ty *= b
},
toString: function () {},
transformPoint: function () {},
translate: function () {},
__toSvgString: function () {
return "matrix(" + [this.a, this.b, this.c, this.d, this.tx, this.ty] + ")"
}
});
flash.geom.Transform = function (a) {
this._target = a;
this._colorTransform = new flash.geom.ColorTransform;
this._matrix = new flash.geom.Matrix
};
fljs.addMethods(flash.geom.Transform, {
setTarget: function (a) {
this._target = a
},
getColorTransform: function () {
return this._colorTransform
},
setColorTransform: function (a) {
this._colorTransform = a;
this._target.__setColorTransform(a)
},
getConcatenatedColorTransform: function () {
for (var a = this._colorTransform, b = this._target, c = fljs.Player.getInstance(); b && b != c;) {
var d = b.getTransform().getColorTransform();
if (!d.__default) {
a = d;
break
}
b = b.getParent()
}
return a
},
getMatrix: function () {
return this._matrix
},
setMatrix: function (a) {
this._matrix =
a;
this._target.__setMatrix(a)
},
notify: function () {
this._target.__setMatrix(this._matrix);
this._target.__setColorTransform(this._colorTransform)
}
});
flash.display.DisplayObject = function () {
flash.events.EventDispatcher.call(this);
this._alpha = 1;
this.blendMode_ = flash.display.BlendMode.NORMAL;
this._transform = new flash.geom.Transform(this);
this.enterFrameListener = fljs.bind(this.onEnterFrame_, this);
fljs.Player.getInstance().dispatcher.addEventListener(flash.events.Event.ENTER_FRAME, this.enterFrameListener);
this.__simpleColorTransform = true;
this.__asContext = null;
(this._clipElement = new fljs.dom.Element).create(fljs.dom.Namespace.Svg, "g");
this.id = "clip" + flash.display.DisplayObject.id++;
this._mouseEventHandler = fljs.bind(this.dispatchMouseEvent, this)
};
fljs.inherits(flash.display.DisplayObject, flash.events.EventDispatcher);
fljs.addMethods(flash.display.DisplayObject, {
getBounds: function (a) {
var b = this.element_.getElement().getBBox();
if (a == this) return new flash.geom.Rectangle(b.x, b.y, b.width, b.height);
else {
var c = new flash.geom.Point(b.x, b.y);
c = a.globalToLocal(this.localToGlobal(c));
b = new flash.geom.Point(b.x + b.width, b.y + b.height);
b = a.globalToLocal(this.localToGlobal(b));
return new flash.geom.Rectangle(c.x, c.y, b.x - c.x, b.y - c.y)
}
},
getRect: function () {},
globalToLocal: function (a) {
var b = this._svgCtm();
a = this._SvgApplyMatrixToPoint(a, b);
return new flash.geom.Point(a.x, a.y)
},
hitTestObject: function (a) {
a = a.getBounds(this);
var b = this.getBounds(this);
return a.x + a.width <= b.x && a.x >= b.x + b.width && a.y + a.height <= b.y && a.y >= b.y + b.height
},
hitTestPoint: function (a, b) {
a = new flash.geom.Point(a, b);
a = this.globalToLocal(a);
b = this.getBounds(this);
return a.x >= b.x && a.x <= b.x + b.width && a.y > b.y && a.y <= b.y + b.height
},
_svgApplyMatrixToPoint: function (a, b) {
var c = fljs.Player.getInstance().element.getElement().createSVGPoint();
c.x = a.x;
c.y = a.y;
return c = c.matrixTransform(b)
},
_svgCtm: function () {
var a = this.element_.getElement(),
b;
try {
b = a.parentNode.getScreenCTM()
} catch (c) {
b = getScreenCTM(a.parentNode)
}
return b
},
localToGlobal: function (a) {
var b = this._svgCtm();
a = this._SvgApplyMatrixToPoint(a, b.inverse());
return new flash.geom.Point(a.x, a.y)
},
onEnterFrame_: function () {},
__setColorTransform: function (a) {
this.element_.getElement().setAttributeNS(null, "opacity", a.alphaMultiplier);
this.element_.getElement().setAttributeNS(null, "stroke-opacity", a.alphaMultiplier);
this.element_.getElement().setAttributeNS(null, "fill-opacity", a.alphaMultiplier);
this.__simpleColorTransform = true
},
setColorTransform: function () {},
__setHitTarget: function (a) {
this.setVisible(false);
this.element_.getElement().setAttributeNS(null, "pointer-events", "all");
this._hitTargetFor = a;
this.addEventListeners()
},
makeClipPath: function () {
this.getClipPath()
},
getClipPath: function () {
this._clipPath || this.buildClipPath();
return this._clipPath
},
buildClipPath: function () {
var a = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "clipPath");
var b = "clip" + flash.display.DisplayObject.id++;
a.sets([["id", b], [null, "clipPathUnits", "userSpaceOnUse"]]);
a.update();
this.__clipElement = a;
a = this._clipPath = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "g");
a.set(null, "clip-path", "url(#" + b + ")");
a.update();
this._clipElement.element.parentNode.replaceChild(a.element, this._clipElement.element);
this._clipElement = a;
this.buildClipParts(this);
fljs.Player.getInstance().defs.append(this.__clipElement)
},
buildClipParts: function (a) {
if (!this._parentClipPaths) this._parentClipPaths = {};
this._parentClipPaths[a.id] = a
},
__setMatrix: function (a) {
this.element_.getElement().setAttributeNS(null, "transform", a.__toSvgString());
if (this._parentClipPaths) for (var b in this._parentClipPaths) {
a = this._parentClipPaths[b];
this.updateClipParts && this.updateClipParts(a)
}
},
addEventListeners: function () {
var a = this._buttonEventHandler = fljs.bind(this._hitTargetFor.updateButtonState, this._hitTargetFor),
b = flash.events.MouseEvent;
this.addEventListener(b.CLICK, a, true);
this.addEventListener(b.MOUSE_OVER, a, true);
this.addEventListener(b.MOUSE_OUT, a, true);
this.addEventListener(b.MOUSE_DOWN, a, true);
this.addEventListener(b.MOUSE_UP, a, true)
},
removeFromStage: function () {
fljs.Player.getInstance().dispatcher.removeEventListener(flash.events.Event.ENTER_FRAME, this.enterFrameListener)
},
updateClipDepth: function (a) {
if (this.__clipDepth) {
if (a != this.__clipDepth) if (a < this.__clipDepth) {;
} else if (a > this.__clipDepth) {}
} else {
this.makeClipPath();
this.__clipDepth = a;
var b = this._parent;
b.element_.getElement();
var c = b.clipPathForDepth(this._depth);
c && c.getClipPath();
var d = document.createDocumentFragment();
for (var e in b.displayList_) {
var f = b.displayList_[e].displayObject;
if (e > this._depth && e <= a && f._mask == c) {
d.appendChild(f._clipElement.element);
f._mask = this
}
}
this.getClipPath().element.appendChild(d)
}
},
getName: function () {
return this._name
},
setName: function (a) {
this._parent && this._parent.setChildName(this, a);
this._name = a
},
getStage: function () {
return this._parent && this._parent.getStage ? this._parent.getStage() : null
},
getTransform: function () {
return this._transform
},
setTransform: function (a) {
this._transform = a;
this._transform.setTarget(this);
this._transform.notify()
},
getMatrix: function () {
return this._transform._matrix
},
setMatrix: function (a) {
this._transform.setMatrix(a)
},
getVisible: function () {
return this._visible
},
setVisible: function (a) {
a = (this._visible = !! a) ? "visible" : "hidden";
this.element_.getElement().setAttributeNS(null, "visibility", a)
},
getParent: function () {
return this._parent
},
setParent: function (a) {
if (this._parent != a) this._parent = a
},
getAs2Object: function () {
if (!this._as2Object) this._as2Object = new fljs.swf.act.MovieClip(this);
return this._as2Object
},
dispatchMouseEvent: function (a) {
var b = {};
b.click = flash.events.MouseEvent.CLICK;
b.touchend = flash.events.MouseEvent.CLICK;
b.mouseover = flash.events.MouseEvent.MOUSE_OVER;
b.mouseout = flash.events.MouseEvent.MOUSE_OUT;
b.mousedown = flash.events.MouseEvent.MOUSE_DOWN;
b.mouseup = flash.events.MouseEvent.MOUSE_UP;
b.touchstart = flash.events.MouseEvent.MOUSE_DOWN;
b.touchend = flash.events.MouseEvent.MOUSE_UP;
this.dispatchEvent(new flash.events.MouseEvent(b[a.type]))
},
getWidth: function () {
return this.element_.element.getBBox().width
},
setWidth: function (a) {
var b = this.getWidth(),
c = this.getMatrix(),
d = new flash.geom.Matrix;
d.scale(a / b, 1);
d.concat(c);
d.tx = c.tx;
d.ty = c.ty;
this.setMatrix(d)
},
getHeight: function () {
return this.element_.element.getBBox().height
}
});
fljs.addEvents(flash.display.DisplayObject, [[flash.events.MouseEvent.MOUSE_OVER, function () {
this.element_.element.addEventListener("mouseover", this._mouseEventHandler, false)},function () {
this.element_.element.removeEventListener("mouseover", this._mouseEventHandler)}], [flash.events.MouseEvent.MOUSE_OUT, function () {
this.element_.element.addEventListener("mouseout", this._mouseEventHandler, false)},function () {
this.element_.element.removeEventListener("mouseout", this._mouseEventHandler)}], [flash.events.MouseEvent.MOUSE_DOWN,
function () {
this.element_.element.addEventListener("mousedown", this._mouseEventHandler, false)},function () {
this.element_.element.removeEventListener("mousedown", this._mouseEventHandler)}], [flash.events.MouseEvent.MOUSE_UP, function () {
this.element_.element.addEventListener("mouseup", this._mouseEventHandler, false)},function () {
this.element_.element.removeEventListener("mouseup", this._mouseEventHandler)}]]);
flash.display.DisplayObject.id = 1;
flash.display.InteractiveObject = function () {
flash.display.DisplayObject.call(this)
};
fljs.inherits(flash.display.InteractiveObject, flash.display.DisplayObject);
flash.display.DisplayObjectContainer = function () {
flash.display.InteractiveObject.call(this);
this.element_ = this._clipElement;
this.graphics_ = new flash.display.Graphics(this);
this.displayList_ = [];
this.__childNames = {}
};
fljs.inherits(flash.display.DisplayObjectContainer, flash.display.InteractiveObject);
fljs.addMethods(flash.display.DisplayObjectContainer, {
addChild: function (a) {
var b = 0;
for (var c in this.displayList_) b = Math.max(c, b);
return this.addChildAt(a, b + 1)
},
addChildAt: function (a, b) {
a._depth = b;
a.setParent(this);
var c = this.element_.getElement(),
d = this.clipPathForDepth(b);
if (d) c = d.getClipPath().element;
var e = this.displayList_[b],
f;
if (e) f = e.displayObject;
if (e && !f.__clipDepth) {
c.replaceChild(a._clipElement.element, f._clipElement.element);
f.removeFromStage()
} else {
e && this.removeChildAt(b);
if ((e = this.dispObjAfterIndex(b)) && d) if (e._mask != d) e = null;
e ? c.insertBefore(a._clipElement.element, e._clipElement.element) : c.appendChild(a._clipElement.element)
}
this.displayList_[b] = {
displayObject: a
};
a.__name && this.setChildName(a, null, a.__name);
if (this._parentClipPaths) for (var g in this._parentClipPaths) a.buildClipParts(this._parentClipPaths[g]);
if (d) a._mask = d;
return a
},
dispObjAfterIndex: function (a) {
var b, c = null;
for (var d in this.displayList_) if (d > a) {
b = c ? Math.min(b, d) : d;
c = this.displayList_[b].displayObject
}
return c
},
areInaccessibleObjectsUnderPoint: function () {
return false
},
contains: function () {},
getChildAt: function (a) {
return (a = this.displayList_[a]) ? a.displayObject : null
},
getChildByName: function (a) {
return this.childrenByName_[a]
},
removeChildAt: function (a) {
var b = this.displayList_[a];
if (b) {
b = b.displayObject;
var c;
c = (c = this.clipPathForDepth(a)) ? c.getClipPath().element : this.element_.getElement();
var d = b._clipElement.element;
if (b.__clipDepth) {
b.getClipPath();
var e = document.createDocumentFragment();
for (var f in this.displayList_) {
var g = this.displayList_[f].displayObject;
if (g._mask == b) {
g._mask = null;
e.appendChild(g._clipElement.element)
}
}
c.replaceChild(e, d)
} else c.removeChild(d);
b.setParent(null);
b.removeFromStage();
b._name && delete this.__childNames[b._name];
delete this.displayList_[a];
return b
} else fljs.console("doc").info("removeChildAt:" + a + " failed")
},
removeChildren: function () {
for (var a in this.displayList_) this.removeChildAt(a)
},
setChildIndex: function () {},
swapChildren: function () {},
swapChildrenAt: function () {},
setChildName: function (a, b) {
a._name && delete this.__childNames[a._name];
this.__childNames[b] = a
},
buildClipParts: function (a) {
fljs.base(this, "buildClipParts", a);
this.graphics_.buildClipParts(a);
for (var b in this.displayList_) {
var c = this.displayList_[b].displayObject;
c.buildClipParts && c.buildClipParts(a)
}
},
updateClipParts: function (a) {
this.graphics_.updateClipParts(a);
for (var b in this.displayList_) {
var c = this.displayList_[b].displayObject;
c.updateClipParts && c.updateClipParts(a)
}
},
updateColorTransform: function () {
for (var a in this.displayList_) {
var b = this.displayList_[a].displayObject;
b.updateColorTransform && b.updateColorTransform()
}
},
__setColorTransform: function (a) {
fljs.base(this, "__setColorTransform", a);
this.updateColorTransform()
},
clipPathForDepth: function (a) {
var b = -1;
for (var c in this.displayList_) {
var d = this.displayList_[c].displayObject;
if (d.__clipDepth) if (a > c && a <= d.__clipDepth) b = Math.max(c, b)
}
return b > -1 ? this.displayList_[b].displayObject : null
}
});
flash.display.Stage = function () {
flash.display.DisplayObjectContainer.call(this);
var a = fljs.Player.getInstance(),
b = a.header.FrameSize.Xmax - a.header.FrameSize.Xmin,
c = a.header.FrameSize.Ymax - a.header.FrameSize.Ymin;
this._clipElement.sets([[null, "width", b], [null, "height", c]]);
this._clipElement.update();
this.align_ = flash.display.StageAlign.TOP_LEFT;
this.displayState_ = flash.display.StageDisplayState.NORMAL;
this.frameRate_ = 30;
a = fljs.Player.getInstance();
b = a.header.FrameSize.Xmax - a.header.FrameSize.Xmin;
c =
a.header.FrameSize.Ymax - a.header.FrameSize.Ymin;
a = this._bg = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "rect");
a.sets([[null, "x", 0], [null, "y", 0], [null, "width", b], [null, "height", c], [null, "stroke", "none"], [null, "fill", this.colorToSvgString(0)]]);
a.update();
(b = this._clipElement.element.firstChild) ? this._clipElement.getElement().insertBefore(a.element, b) : this._clipElement.getElement().appendChild(a.element)
};
fljs.inherits(flash.display.Stage, flash.display.DisplayObjectContainer);
fljs.addMethods(flash.display.Stage, {
initialize: function () {
this.setBackgroundColor_(0)
},
invalidate: function () {},
isFocusInaccessible: function () {},
runFrameLoop_: function () {},
onEnterFrame_: function () {
for (var a in this.children_) this.children_.onEnterFrame()
},
colorToSvgString: function (a) {
return "rgb(" + [a >> 16 & 255, a >> 8 & 255, a & 255] + ")"
},
setBackgroundColor_: function (a) {
this._bg.set(null, "fill", this.colorToSvgString(a));
this._bg.update()
},
onMouseMove: function (a) {
this._mouseX = a.clientX;
this._mouseY = a.clientY
},
getStage: function () {
return this
},
getFrameRate: function () {
return this.frameRate_
},
setFrameRate: function (a) {
this.frameRate_ = a = Math.max(Math.min(a, 1E3), 0.01)
}
});
flash.display.GradientType = function () {};
fljs.addConstants(flash.display.GradientType, {
LINEAR: "linear",
RADIAL: "radial"
});
flash.display.SpreadMethod = function () {};
fljs.addConstants(flash.display.SpreadMethod, {
PAD: "pad",
REFLECT: "reflect",
REPEAT: "repeat"
});
flash.display.InterpolationMethod = function () {};
fljs.addConstants(flash.display.InterpolationMethod, {
LINEAR_RGB: "linearRGB",
RGB: "rgb"
});
flash.display.Graphics = function (a) {
this.__target = a;
this.setDisplayObject(a);
this._parentClipPaths = {};
this._clipParts = {};
this._parts = []
};
fljs.addMethods(flash.display.Graphics, {
clear: function () {
for (var a in this._parts) this.parentEl.removeChild(this._parts[a]);
this._parts = [];
this._clipParts = {};
this._parentClipPaths = {}
},
opacityWithXform: function (a) {
var b = this.displayObject_.getTransform().getConcatenatedColorTransform();
return b.__default ? a : Math.max(0, Math.min(255, Math.round(a * 255 * b.alphaMultiplier + b.alphaOffset))) / 255
},
setDisplayObject: function (a) {
this.displayObject_ = a;
this.parentEl = this.displayObject_.element_.element
},
__colorToSvgString: function (a) {
var b =
a >> 16 & 255,
c = a >> 8 & 255;
a = a & 255;
if (!this.displayObject_.getTransform().getConcatenatedColorTransform().__default) {
var d = this.displayObject_.getTransform().getConcatenatedColorTransform();
b = Math.max(0, Math.min(255, Math.round(b * d.redMultiplier + d.redOffset)));
c = Math.max(0, Math.min(255, Math.round(c * d.greenMultiplier + d.greenOffset)));
a = Math.max(0, Math.min(255, Math.round(a * d.blueMultiplier + d.blueOffset)))
}
return "rgb(" + [b, c, a] + ")"
},
clipTransforms: function (a) {
for (var b = [], c = this.displayObject_;;) {
var d = c.getMatrix().__toSvgString();
b.push(d);
if (c == a) break;
c = c.getParent()
}
return b
},
buildClipParts: function (a) {
this._parentClipPaths[a.id] = a;
var b = this.clipTransforms(a).join(" ");
if (this.tag) {
var c = this.tag.def.paths;
for (var d in c) {
var e = c[d],
f;
f = fljs.agent.browser == "Safari" ? e.clone() : e.use();
f.set(null, "transform", b);
f.update();
this.addClipPart(a, e, f)
}
}
},
addClipPart: function (a, b, c) {
this._clipParts[a.id] || (this._clipParts[a.id] = {});
this._clipParts[a.id][b.id] = c;
a.__clipElement.append(c)
},
updateClipParts: function (a) {
var b = this.clipTransforms(a);
for (a = a;;) {
if (this._parentClipPaths[a.id]) {
var c = b.join(" "),
d = this._clipParts[a.id];
for (var e in d) {
var f = d[e];
f.set(null, "transform", c);
f.update()
}
}
if (!a || !a.getTransform) break;
c = a.getMatrix().__toSvgString();
b.push(c);
a = a.getParent()
}
},
useTag: function (a, b, c) {
var d = this.displayObject_.getTransform().getConcatenatedColorTransform();
d.__default || (b = d);
this.tag = a;
this.cloning = c;
this.use = a.def.use(b, null, this.cloning);
this.parentEl.appendChild(this.use.element)
},
setColorTransform: function (a) {
if (this.use) {
var b =
this.use.element;
this.use = this.tag.def.use(a, null, this.cloning);
this.parentEl.replaceChild(this.use.element, b)
}
}
});
flash.display.Graphics.patternId = 1;
flash.display.Graphics.pathId = 1;
flash.display.IBitmapDrawable = function () {};
flash.display.StageAlign = function () {};
fljs.addConstants(flash.display.StageAlign, {
TOP: "top",
BOTTOM: "bottom",
LEFT: "left",
RIGHT: "right",
TOP_LEFT: "topLeft",
TOP_RIGHT: "topRight",
BOTTOM_LEFT: "bottomLeft",
BOTTOM_RIGHT: "bottomRight"
});
flash.display.StageDisplayState = function () {};
fljs.addConstants(flash.display.StageDisplayState, {
FULL_SCREEN: "fullScreen",
NORMAL: "normal"
});
fljs.swf = {};
fljs.swf.tag = {};
fljs.swf.tag.End = function () {};
fljs.addMethods(fljs.swf.tag.End, {
read: function () {},
evaluate: function () {}
});
fljs.swf.tag.ShowFrame = function () {};
fljs.addMethods(fljs.swf.tag.ShowFrame, {
read: function () {},
evaluate: function () {}
});
flash.display.Shape = function () {
flash.display.DisplayObject.call(this);
this.element_ = this._clipElement;
this.graphics_ = new flash.display.Graphics(this)
};
fljs.inherits(flash.display.Shape, flash.display.DisplayObject);
fljs.addMethods(flash.display.Shape, {
buildClipParts: function (a) {
fljs.base(this, "buildClipParts", a);
this.graphics_.buildClipParts(a)
},
updateClipParts: function (a) {
this.graphics_.updateClipParts(a)
},
useTag: function (a, b, c) {
this.tag = a;
this.graphics_.useTag(a, b, c);
if (b) {
this.setColorTransform(b);
this.element_.getElement().setAttributeNS(null, "opacity", b.alphaMultiplier)
}
},
updateColorTransform: function () {
this.graphics_.setColorTransform(this.getTransform().getConcatenatedColorTransform())
},
__setColorTransform: function (a) {
fljs.base(this, "__setColorTransform", a);
this.graphics_.setColorTransform(a)
}
});
fljs.swf.tag.PlaceObject = function () {};
fljs.addMethods(fljs.swf.tag.PlaceObject, {
read: function (a, b) {
var c = a.stream.byteIndex;
this.CharacterId = a.readUI16();
this.Depth = a.readUI16();
this.Matrix = a.readMATRIX();
a.stream.align();
if (a.stream.byteIndex != c + b.TagLength) {
fljs.console("parse").info("reading cxform");
this.ColorTransform = a.readCXFORM()
}
a.stream.align()
},
buildMatrix_: function () {
return new flash.geom.Matrix(this.Matrix.ScaleX, this.Matrix.RotateSkew0, this.Matrix.RotateSkew1, this.Matrix.ScaleY, this.Matrix.TranslateX, this.Matrix.TranslateY)
},
buildColorTransform_: function () {
var a = this.ColorTransform;
return new flash.geom.ColorTransform(a.RedMultTerm, a.GreenMultTerm, a.BlueMultTerm, a.AlphaMultTerm, a.RedAddTerm, a.GreenAddTerm, a.BlueAddTerm, a.AlphaAddTerm)
},
evaluate: function (a, b, c, d) {
b = fljs.console("eval");
c = a.dictionary[this.CharacterId];
var e;
if (c instanceof fljs.swf.tag.DefineShape || c instanceof fljs.swf.tag.DefineShape2) {
e = new flash.display.Shape;
e.getTransform().setMatrix(this.buildMatrix_());
this.ColorTransform && e.getTransform().setColorTransform(this.buildColorTransform_());
e.useTag(c)
} else if (c instanceof fljs.swf.tag.DefineBitsJPEG2) {
e = c.buildBitmap(fljs.Player.getInstance());
e.getTransform().setMatrix(this.buildMatrix_())
} else if (c instanceof fljs.swf.tag.DefineButton2) {
e = c.build(a);
e.getTransform().setMatrix(this.buildMatrix_())
}
e ? d.addChildAt(e, this.Depth) : b.info("not recognized: " + [this.CharacterId, this.Name])
}
});
fljs.swf.tag.RemoveObject = function () {};
fljs.addMethods(fljs.swf.tag.RemoveObject, {
read: function (a) {
this.CharacterId = a.readUI16();
this.Depth = a.readUI16()
},
evaluate: function (a, b, c, d) {
d.removeChildAt(this.Depth)
}
});
fljs.swf.tag.PlaceObject2 = function () {};
fljs.addMethods(fljs.swf.tag.PlaceObject2, {
read: function (a) {
this.startByteIndex = a.stream.byteIndex;
fljs.console("parse");
this.PlaceFlagHasClipActions = a.readUB(1);
this.PlaceFlagHasClipDepth = a.readUB(1);
this.PlaceFlagHasName = a.readUB(1);
this.PlaceFlagHasRatio = a.readUB(1);
this.PlaceFlagHasColorTransform = a.readUB(1);
this.PlaceFlagHasMatrix = a.readUB(1);
this.PlaceFlagHasCharacter = a.readUB(1);
this.PlaceFlagMove = a.readUB(1);
this.Depth = a.readUI16();
if (this.PlaceFlagHasCharacter) this.CharacterId = a.readUI16();
if (this.PlaceFlagHasMatrix) this.Matrix = a.readMATRIX();
if (this.PlaceFlagHasColorTransform) this.ColorTransform = a.readCXFORMWITHALPHA();
if (this.PlaceFlagHasRatio) this.Ratio = a.readUI16();
if (this.PlaceFlagHasName) this.Name = a.readSTRING();
if (this.PlaceFlagHasClipDepth) this.ClipDepth = a.readUI16();
if (this.PlaceFlagHasClipActions) this.ClipActions = a.readCLIPACTIONS()
},
buildMatrix_: function () {
return new flash.geom.Matrix(this.Matrix.ScaleX, this.Matrix.RotateSkew0, this.Matrix.RotateSkew1, this.Matrix.ScaleY, this.Matrix.TranslateX, this.Matrix.TranslateY)
},
buildColorTransform_: function () {
var a = this.ColorTransform;
return new flash.geom.ColorTransform(a.RedMultTerm, a.GreenMultTerm, a.BlueMultTerm, a.AlphaMultTerm, a.RedAddTerm, a.GreenAddTerm, a.BlueAddTerm, a.AlphaAddTerm)
},
evaluate: function (a, b, c, d) {
var e;
c = fljs.console("place");
if (this.PlaceFlagMove && this.PlaceFlagHasCharacter) e = d.getChildAt(this.Depth);
var f;
if (this.ColorTransform) f = this.buildColorTransform_();
if (this.PlaceFlagHasCharacter) {
b = a.dictionary[this.CharacterId];
var g;
if (b instanceof fljs.swf.tag.DefineShape || b instanceof fljs.swf.tag.DefineEditText || b instanceof fljs.swf.tag.DefineText || b instanceof fljs.swf.tag.DefineSprite || b instanceof fljs.swf.tag.DefineButton2) g = b.build(a, f);
if (g) {
this.Matrix && g.getTransform().setMatrix(this.buildMatrix_());
d.addChildAt(g, this.Depth);
if (e) this.Matrix || g.getTransform().setMatrix(e.getTransform().getMatrix());
if (g.__clipActions == null) g.__clipActions = {};
if (this.ClipActions) {
f = fljs.swf.ClipEventFlags;
d = this.ClipActions.ClipActionRecords;
for (var j in d) {
e = d[j];
for (var h in fljs.swf.ClipEventFlags) if (e.EventFlags & f[h]) {
g.__clipActions[h] || (g.__clipActions[h] = []);
g.__clipActions[h].push(e)
}
}
}
if (b instanceof fljs.swf.tag.DefineSprite || b instanceof fljs.swf.tag.DefineButton2) g.onCreate()
} else {
c.info("not recognized: " + [this.CharacterId, this.Name]);
e && d.removeChildAt(this.Depth)
}
} else if (this.PlaceFlagMove) {
g = d.getChildAt(this.Depth);
if (!g) return;
h = false;
if (this.Matrix) {
g.getTransform().setMatrix(this.buildMatrix_());
h = true
}
if (f) {
g.getTransform().setColorTransform(f);
h = true
}
if (h && a.renderTextAsGlyphs) if (g.text_ || g._text) if (g.getParent()) {
j = 0;
h = g._clipElement.element;
h = b = h.parentNode;
b = h.parentNode;
d = h.nextSibling;
b.removeChild(h);
f && g.getTransform().setColorTransform(f);
this.Matrix && g.getTransform().setMatrix(this.buildMatrix_());
d ? b.insertBefore(h, d) : b.appendChild(h)
}
}
if (g) {
this.PlaceFlagHasClipDepth && g.updateClipDepth(this.ClipDepth);
this.Name && g.setName(this.Name);
if (g && this.PlaceFlagHasCharacter) {
if (g.__clipActions.ClipEventInitialize) {
f = [];
for (j in g.__clipActions.ClipEventInitialize) f.push.apply(f, g.__clipActions.ClipEventInitialize[j].Actions);
a.doActions(g, f)
}
if (g.__clipActions.ClipEventLoad) {
f = [];
for (j in g.__clipActions.ClipEventLoad) f.push.apply(f, g.__clipActions.ClipEventLoad[j].Actions);
a.doActions(g, f)
}
if (g.__clipActions.ClipEventEnterFrame) {
f = [];
for (j in g.__clipActions.ClipEventEnterFrame) f.push.apply(f, g.__clipActions.ClipEventEnterFrame[j].Actions);
a.dispatcher.addEventListener(flash.events.Event.ENTER_FRAME, fljs.bind(a.doActions, a, g, f))
}
}
}
}
});
fljs.swf.build = {};
fljs.swf.build.SvgUtils = function () {};
fljs.addMethods(fljs.swf.build.SvgUtils, {
toSvgColorString: function (a) {
return "rgb(" + [a.Red, a.Green, a.Blue] + ")"
},
toSvgOpacity: function (a) {
return a.Alpha == null ? 1 : a.Alpha / 255
},
toSvgMatrixString: function (a) {
return (new flash.geom.Matrix(a.ScaleX, a.RotateSkew0, a.RotateSkew1, a.ScaleY, a.TranslateX, a.TranslateY)).__toSvgString()
},
toMatrix: function (a) {
return new flash.geom.Matrix(a.ScaleX, a.RotateSkew0, a.RotateSkew1, a.ScaleY, a.TranslateX, a.TranslateY)
}
});
fljs.swf.def = {};
fljs.swf.def.BitmapDef = function () {
(this.element = new fljs.dom.Element).create(fljs.dom.Namespace.Svg, "image")
};
fljs.addMethods(fljs.swf.def.BitmapDef, {
setCharaId: function (a) {
this.id = "bitmap-" + a;
this.ref = "#" + this.id;
this.element.set("id", this.id)
},
define: function () {
this.element.update();
this._define(this.element.element)
},
use: function () {
var a = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "use");
a.sets([[fljs.dom.Namespace.Xlink, "xlink:href", this.ref]]);
a.update();
return a
},
_define: function (a) {
fljs.Player.getInstance().defs.element.appendChild(a)
}
});
fljs.swf.def.BitmapFillDef = function () {
var a = this.element = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "pattern");
this.type = "Bitmap";
this.id = "pattern-" + fljs.swf.def.BitmapFillDef.patternId++;
this.ref = "#" + this.id;
a.set("id", this.id)
};
fljs.addMethods(fljs.swf.def.BitmapFillDef, {
setBitmapId: function (a) {
a = fljs.Player.getInstance().dictionary[a];
if (!a) return false;
this.bitmap = a;
this.element.append(a.def.use());
return true
},
define: function () {
this.element.update();
this._define(this.element.element)
},
use: function () {
var a = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "use");
a.sets([[fljs.dom.Namespace.Xlink, "xlink:href", this.ref]]);
a.update();
return a
},
_define: function (a) {
fljs.Player.getInstance().defs.element.appendChild(a)
}
});
fljs.swf.def.BitmapFillDef.patternId = 1;
fljs.swf.def.GradientFillDef = function () {
this.element = new fljs.dom.Element;
this.stops = [];
this.type = "Gradient"
};
fljs.addMethods(fljs.swf.def.GradientFillDef, {
create: function (a) {
var b = this.element;
b.create(fljs.dom.Namespace.Svg, a);
this.id = "gradient-" + fljs.swf.def.GradientFillDef.gradientId++;
this.ref = "#" + this.id;
b.set("id", this.id)
},
addStop: function (a) {
this.stops.push(a);
this.element.append(a.element)
},
define: function () {
this.element.update();
this._define(this.element.element)
},
use: function (a) {
var b = this.element.clone(false);
b.id = "gradient-" + fljs.swf.def.GradientFillDef.gradientId++;
b.ref = "#" + b.id;
b.set("id", b.id);
for (var c in this.stops) b.append(this.stops[c].use(a));
b.update();
this._define(b.element);
return b
},
_define: function (a) {
fljs.Player.getInstance().defs.element.appendChild(a)
}
});
fljs.swf.def.GradientFillDef.gradientId = 1;
fljs.swf.def.GradientFillStopDef = function () {
(this.element = new fljs.dom.Element).create(fljs.dom.Namespace.Svg, "stop")
};
fljs.addMethods(fljs.swf.def.GradientFillStopDef, {
create: function (a) {
var b = this.element;
b.create(fljs.dom.Namespace.Svg, a);
b.set("id", this.id)
},
setColor: function (a, b) {
this.rgba = a;
this.element.sets([[null, "stop-color", this._colorToSvgColor(a, b)], [null, "stop-opacity", this._colorToSvgOpacity(a)]])
},
define: function () {
this.element.update();
this._define(this.element.element)
},
use: function (a) {
var b = this.element.clone(false);
a = [[null, "stop-color", this._colorToSvgColor(this.rgba, a)]];
b.sets(a);
b.update();
return b
},
_define: function (a) {
fljs.Player.getInstance().defs.element.appendChild(a)
},
_colorToSvgColor: function (a, b) {
var c = a >> 24 & 255,
d = a >> 16 & 255;
a = a >> 8 & 255;
if (b) {
c = Math.max(0, Math.min(255, Math.round(c * b.redMultiplier + b.redOffset)));
d = Math.max(0, Math.min(255, Math.round(d * b.greenMultiplier + b.greenOffset)));
a = Math.max(0, Math.min(255, Math.round(a * b.blueMultiplier + b.blueOffset)))
}
return "rgb(" + [c, d, a] + ")"
},
_colorToSvgOpacity: function (a, b) {
a = (a & 255) / 255;
if (b) a = Math.max(0, Math.min(1, Math.round(a * b.alphaMultiplier + b.alphaOffset)));
return a
}
});
fljs.swf.def.GradientFillStopDef.gradientStopId = 1;
fljs.swf.def.PathDef = function () {
var a = this.element = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "path");
this.id = "path" + fljs.swf.def.PathDef.pathId++;
this.ref = "#" + this.id;
a.set("id", this.id);
a.update()
};
fljs.addMethods(fljs.swf.def.PathDef, {
setStroke: function (a) {
(this.stroke = a) ? this.element.sets([[null, "stroke-width", a.thickness], [null, "stroke", this._colorToSvgColor(a.color)], [null, "stroke-opacity", this._colorToSvgOpacity(a.color)]]) : this.element.set(null, "stroke", "none")
},
setFill: function (a) {
if (this.fill = a) switch (a.type) {
case "Solid":
this._setSolidFill(a);
break;
case "Bitmap":
this._setBitmapFill(a);
break;
case "Gradient":
this._setGradientFill(a);
break
} else this.element.set(null, "fill", "none")
},
_setSolidFill: function () {},
_setBitmapFill: function (a) {
this.element.sets([[null, "fill", "url(" + a.ref + ")"], [null, "fill-opacity", 1]])
},
_setGradientFill: function () {},
define: function () {
this.element.update();
this._define(this.element.element)
},
use: function (a, b) {
var c = new fljs.dom.Element;
c.create(fljs.dom.Namespace.Svg, "use");
document.getElementById(this.id);
var d = [[fljs.dom.Namespace.Xlink, "xlink:href", this.ref]],
e = this.stroke;
e && c.sets([[null, "stroke-width", e.thickness], [null, "stroke", this._colorToSvgColor(e.color, a)], [null, "stroke-opacity",
this._colorToSvgOpacity(e.color)]]);
if (e = this.fill) switch (e.type) {
case "Solid":
c.set(null, "fill", this._colorToSvgColor(e.color, a));
c.set(null, "fill-opacity", this._colorToSvgOpacity(e.color));
break;
case "Bitmap":
break;
case "Gradient":
c.sets([[null, "fill", "url(" + e.use(a).ref + ")"], [null, "fill-opacity", 1]]);
break
}
c.sets(d);
b && b.append(c);
c.update();
return c
},
clone: function () {
var a = this.element.clone(true);
a.set("id", null);
return a
},
_colorToSvgColor: function (a, b) {
var c = a >> 24 & 255,
d = a >> 16 & 255;
a = a >> 8 & 255;
if (b) {
c = Math.max(0, Math.min(255, Math.round(c * b.redMultiplier + b.redOffset)));
d = Math.max(0, Math.min(255, Math.round(d * b.greenMultiplier + b.greenOffset)));
a = Math.max(0, Math.min(255, Math.round(a * b.blueMultiplier + b.blueOffset)))
}
return "rgb(" + [c, d, a] + ")"
},
_colorToSvgOpacity: function (a, b) {
a = (a & 255) / 255;
if (b) a = Math.max(0, Math.min(1, Math.round(a * b.alphaMultiplier + b.alphaOffset)));
return a
},
_define: function (a) {
fljs.Player.getInstance().defs.element.appendChild(a)
}
});
fljs.swf.def.PathDef.pathId = 1;
fljs.swf.def.ShapeDef = function () {
(this.element = new fljs.dom.Element).create(fljs.dom.Namespace.Svg, "g");
this.parts = [];
this.paths = [];
this.images = [];
this.cxforms = {};
this.cxformCount = 0
};
fljs.addMethods(fljs.swf.def.ShapeDef, {
setCharaId: function (a) {
this.id = "chara-" + a;
this.ref = "#" + this.id;
this.element.set("id", this.id)
},
addPath: function (a) {
this.paths.push(a);
this.parts.push(a);
this.element.append(a.element)
},
addImage: function (a) {
this.images.push(a);
this.parts.push(a);
this.element.append(a.element)
},
define: function () {
this.element.update();
fljs.Player.getInstance();
this._define(this.element.element)
},
use: function (a, b, c) {
if (c) {
a = this.element.clone(true);
b && b.append(a);
return a
}
if (!a) a = flash.geom.ColorTransform.identity;
c = a.__toSvgString();
a = c in this.cxforms ? this.cxforms[c] : (this.cxforms[c] = this.useDef(a));
c = new fljs.dom.Element;
c.create(fljs.dom.Namespace.Svg, "use");
document.getElementById(a.id);
b && b.append(c);
c.element.setAttributeNS(fljs.dom.Namespace.Xlink, "xlink:href", a.ref);
return c
},
useDef: function (a) {
var b = new fljs.dom.Element;
b.create(fljs.dom.Namespace.Svg, "g");
var c = [this.id, this.cxformCount++].join("-");
b.sets([["id", c]]);
b.update();
this._define(b.element);
var d = this.parts;
for (var e in d) d[e].use(a, b);
return {
element: b,
id: c,
ref: "#" + c
}
},
_define: function (a) {
fljs.Player.getInstance().defs.element.appendChild(a)
}
});
fljs.swf.def.ImageDef = function () {
var a = this.element = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "g");
this.id = "image-def-" + fljs.swf.def.ImageDef.id++;
this.ref = "#" + this.id;
a.set("id", this.id)
};
fljs.addMethods(fljs.swf.def.ImageDef, {
setBitmapId: function (a) {
a = fljs.Player.getInstance().dictionary[a];
if (!a) return false;
this.bitmap = a;
this._use = a.def.use();
this.element.append(this._use);
return true
},
define: function () {
this.element.update();
this._define(this.element.element)
},
use: function (a, b) {
a = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "use");
a.sets([[fljs.dom.Namespace.Xlink, "xlink:href", this.ref]]);
a.update();
b && b.append(a);
return a
},
_define: function (a) {
fljs.Player.getInstance().defs.element.appendChild(a)
}
});
fljs.swf.def.ImageDef.id = 1;
fljs.swf.BigEndianStringStream = function (a) {
this.buffer = a;
this.bitIndex = this.byteIndex = this._byte = 0;
this.byteIndexForBits = -1;
this.logger = fljs.console("parse")
};
fljs.addMethods(fljs.swf.BigEndianStringStream, {
length: function () {
return this.buffer.length
},
hasMore: function () {
return this.byteIndex < this.buffer.length
},
skipBytes: function (a) {
this.byteIndex += a
},
readBytes: function (a) {
for (var b = [], c = 0; c < a; c++) b.push(this.buffer.charCodeAt(this.byteIndex++) & 255);
return b
},
align: function () {
this.bitIndex = 8
},
nextUByte: function () {
return this.buffer.charCodeAt(this.byteIndex++) & 255
},
nextSByte: function () {
var a = this.buffer.charCodeAt(this.byteIndex++) & 255;
if (a >= 128) a -= 256;
return a
},
nextUShort: function () {
var a = ((this.buffer.charCodeAt(this.byteIndex++) & 255) << 8) + (this.buffer.charCodeAt(this.byteIndex++) & 255);
if (a < 0) a += 65536;
return a
}
});
fljs.swf.ClipEventFlags = {
ClipEventKeyUp: -2147483648,
ClipEventKeyDown: 1073741824,
ClipEventMouseUp: 536870912,
ClipEventMouseDown: 268435456,
ClipEventMouseMove: 134217728,
ClipEventUnload: 67108864,
ClipEventEnterFrame: 33554432,
ClipEventLoad: 16777216,
ClipEventDragOver: 8388608,
ClipEventRollOut: 4194304,
ClipEventRollOver: 2097152,
ClipEventReleaseOutside: 1048576,
ClipEventRelease: 524288,
ClipEventPress: 262144,
ClipEventInitialize: 131072,
ClipEventData: 65536,
ClipEventConstruct: 1024,
ClipEventKeyPress: 512,
ClipEventDragOut: 256
};
fljs.swf.FillStyleTypes = {
SolidFill: 0,
LinearGradientFill: 16,
RadialGradientFill: 18,
FocalRadialGradientFill: 19,
RepeatingBitmapFill: 64,
ClippedBitmapFill: 65,
NonSmoothedRepeatingBitmapFill: 66,
NonSmoothedClippedBitmapFill: 67
};
fljs.swf.SpreadMethods = {
Pad: 0,
Reflect: 1,
Repeat: 2
};
fljs.swf.InterpolationMethods = {
Rgb: 0,
LinearRgb: 1
};
fljs.swf.build.ShapeBuilder = function (a) {
this.context = a;
this.utils = new fljs.swf.build.SvgUtils
};
fljs.addMethods(fljs.swf.build.ShapeBuilder, {
build: function (a) {
var b = this.parseSwfPaths(a),
c = [];
for (var d in b) c.push([this.buildPaths(b[d][0]), this.buildPaths(b[d][1])]);
return this.buildDefinition(a, c)
},
parseSwfPaths: function (a) {
var b = 0,
c = 0,
d = 0,
e = 0,
f = 0,
g = 0,
j = a.Shapes.ShapeRecords,
h = this.stateNewStyles(a.Shapes.FillStyles),
m = this.stateNewStyles(a.Shapes.LineStyles),
k = [],
l = 0,
n = 0,
p = 0,
u = 1,
o = {
x1: 0,
y1: 0
},
q = [],
s = this;
a = function () {
o.parts = q;
o.flipped = false;
o.x2 = q[q.length - 1].x2;
o.y2 = q[q.length - 1].y2;
o.key1 =
s.pointKey(o.x1, o.y1);
o.key2 = s.pointKey(o.x2, o.y2);
o.key = u += 1;
l && h[l].edges.push(o);
if (n) h[n].edges.push({
parts: q,
flipped: true,
x1: o.x2,
y1: o.y2,
x2: o.x1,
y2: o.y1,
key1: o.key2,
key2: o.key1,
key: u += 1
});
p && m[p].edges.push(o);
o = {
x1: o.x2,
y1: o.y2
};
q = []
};
var r = function () {
k.push([h, m])
},
t = function (w) {
return Math.round(w * 100) / 100
};
for (var v in j) {
g = j[v];
switch (g.type) {
case "STRAIGHT":
f = b + g.DeltaX;
g = c + g.DeltaY;
q.push({
x1: t(b),
y1: t(c),
x2: t(f),
y2: t(g)
});
b = f;
c = g;
break;
case "CURVED":
d = b + g.ControlDeltaX;
e = c + g.ControlDeltaY;
f = d + g.AnchorDeltaX;
g = e + g.AnchorDeltaY;
q.push({
x1: t(b),
y1: t(c),
cx: t(d),
cy: t(e),
x2: t(f),
y2: t(g)
});
b = f;
c = g;
break;
case "NONEDGE":
q.length && a();
if (g.StateNewStyles) {
r();
h = this.stateNewStyles(g.FillStyles);
m = this.stateNewStyles(g.LineStyles)
}
if (g.StateLineStyle) p = g.LineStyle;
if (g.StateFillStyle0) l = g.FillStyle0;
if (g.StateFillStyle1) n = g.FillStyle1;
if (g.StateMoveTo) {
b = g.MoveDeltaX;
c = g.MoveDeltaY;
o.x1 = b;
o.y1 = c
}
break
}
}
q.length && a();
r();
return k
},
stateNewStyles: function (a) {
var b = [{
edges: [],
style: null}];
for (var c in a) b.push({
edges: [],
style: a[c]
});
return b
},
buildPaths: function (a) {
var b = [],
c, d, e, f, g, j, h, m, k, l;
for (e = 0; e < a.length; e++) {
d = a[e].edges;
if (d.length != 0) {
j = {};
edgeIndexCount = {};
m = [];
for (f = h = 0; f < d.length; f++) {
c = d[f];
if (c.key1 == c.key2) {
c.picked = true;
h += 1;
m.push([c])
} else {
c.picked = false;
j[c.key1] || (j[c.key1] = []);
j[c.key1].push(c)
}
}
for (f = 0; f < d.length; f++) {
if (h == d.length) break;
c = d[f];
if (!c.picked) {
k = [c];
c.picked = true;
h += 1;
l = j[c.key1];
for (g = 0; g < l.length; g++) if (l[g] == c) {
l.splice(g, 1);
break
}
g = c.key1;
for (c = c.key2; c != g;) {
l = j[c];
if (typeof l == "undefined") break;
if (l.length == 0) break;
c = l.shift();
k.push(c);
c.picked = true;
h += 1;
c = c.key2
}
m.push(k)
}
}
m.length && b.push({
path: m,
style: a[e].style
})
}
}
return b
},
pointKey: function (a, b) {
return [a, b].join(",")
},
buildDefinition: function (a, b) {
var c = new fljs.swf.def.ShapeDef;
c.setCharaId(a.ShapeId);
for (var d in b) {
a = b[d][0];
for (var e in a) {
var f = a[e];
if (this.isImagePath(f)) {
var g = new fljs.swf.def.ImageDef;
this.buildImageDef(g, f);
c.addImage(g)
} else {
f.style.def = this.buildFillDef(f.style);
f = this.buildPathDefinition(f.path, f.style, null);
c.addPath(f)
}
}
a = b[d][1];
for (e in a) {
f = a[e];
f = this.buildPathDefinition(f.path, null, f.style);
c.addPath(f)
}
}
c.define();
return c
},
sameStyle: function (a, b) {
if (!a || !b) return false;
if (a.def && b.def && a.def.fill && b.def.fill) if (a.def.fill.type == "Solid" && b.def.fill.type == "Solid") {
if (a.def.fill.color != b.def.fill.color) return false
} else return false;
else if (a.def && b.def && (a.def.fill || b.def.fill)) return false;
var c, d;
c = a.HasFillFlag && a.FillType.Color ? a.FillType.Color : a.Color;
if (b.HasFillFlag && b.FillType.Color) bcolor = b.FillType.Color;
else d = b.Color;
if (c && d) {
if (this.rgbaToColor(c) != this.rgbaToColor(d)) return false;
if (a.Width != b.Width) return false
} else if (c || d) return false;
return true
},
buildPathDefinition: function (a, b, c) {
var d = new fljs.swf.def.PathDef;
this.setPathLineStyle(d, c);
this.setPathFillStyle(d, b);
d.element.set(null, "d", this.pathToString(a));
d.define();
return d
},
isImagePath: function (a) {
if (a.path.length != 1 || a.path[0].length != 1 || a.path[0][0].parts.length != 4 || !a.style) return false;
var b = a.style.FillStyleType,
c = fljs.swf.FillStyleTypes;
if (!(b == c.RepeatingBitmapFill || b == c.ClippedBitmapFill || b == c.NonSmoothedRepeatingBitmapFill || b == c.NonSmoothedClippedBitmapFill)) return false;
if (!fljs.Player.getInstance().dictionary[a.style.BitmapId]) return false;
a = a.path[0][0].parts;
for (b = 0; b < a.length; b++) {
if (typeof a[b].cx != "undefined") return false;
if (b < a.length - 1) {
var d = a[b],
e = a[b + 1],
f, g, j;
if (d.flipped) {
f = d.x2;
c = d.y2;
g = d.x1;
d = d.y1
} else {
f = d.x1;
c = d.y1;
g = d.x2;
d = d.y2
}
if (e.flipped) {
j = e.x1;
e = e.y1
} else {
j = e.x2;
e = e.y2
}
f = (f - g) * (j - g);
c = (c - d) * (e - d);
g = f + c;
if (Math.abs(g) > 0.01) {
if (!f || !c) return false;
if (Math.abs(g / f) > 0.01 || Math.abs(g / c) > 0.01) return false
}
}
}
return true
},
buildImageDef: function (a, b) {
a.setBitmapId(b.style.BitmapId);
for (var c = [], d = 0, e = 0, f = b.path[0][0].parts, g = 0; g < f.length; g++) {
var j = f[g],
h = Math.abs(j.x2 - j.x1);
j = Math.abs(j.y2 - j.y1);
if (h > d) d = h;
if (j > e) e = j
}
a._use.set(null, "x", 0);
a._use.set(null, "y", 0);
a._use.set(null, "width", d);
a._use.set(null, "height", e);
if (b = b.style.BitmapMatrix) {
b = this.utils.toMatrix(b);
b.a /= 20;
b.b /= 20;
b.c /= 20;
b.d /= 20;
c.push("translate(" + [b.tx, b.ty] + ")");
b.tx = 0;
b.ty = 0;
c.push(b.__toSvgString())
}
a._use.set(null, "transform", c.toString());
a._use.update();
a.element.update();
a.define()
},
appendPathToDef: function (a, b) {
a = a.element.element;
b = a.getAttributeNS(null, "d") + " " + this.pathToString(b);
a.setAttributeNS(null, "d", b)
},
pathToString: function (a) {
var b, c, d = [];
for (var e in a) {
var f = a[e];
d.push("M", f[0].x1, f[0].y1);
for (var g in f) {
b = f[g];
if (b.flipped) for (var j = b.parts.length - 1; j >= 0; j--) {
c = b.parts[j];
typeof c.cx == "undefined" ? d.push("L", c.x1, c.y1) : d.push("Q", c.cx, c.cy, c.x1, c.y1)
} else for (j in b.parts) {
c = b.parts[j];
typeof c.cx == "undefined" ? d.push("L", c.x2, c.y2) : d.push("Q", c.cx, c.cy, c.x2, c.y2)
}
}
}
return d.join(" ")
},
setPathLineStyle: function (a, b) {
if (b) {
var c = {};
c = b.HasFillFlag ? b.FillType.Color ? {
thickness: Math.max(b.Width, 1),
color: this.rgbaToColor(b.FillType.Color)
} : {
thickness: 1,
color: 0
} : {
thickness: Math.max(b.Width, 1),
color: this.rgbaToColor(b.Color)
};
a.setStroke(c)
} else a.setStroke(null)
},
setPathFillStyle: function (a, b) {
if (b) if (b.FillStyleType == fljs.swf.FillStyleTypes.SolidFill) this.setPathSolidFillStyle(a, b);
else b.def && a.setFill(b.def);
else a.setFill(null)
},
setPathSolidFillStyle: function (a, b) {
a.setFill({
type: "Solid",
color: this.rgbaToColor(b.Color)
})
},
buildFillDef: function (a) {
if (!a) return null;
var b = a.FillStyleType,
c = fljs.swf.FillStyleTypes;
return b == c.LinearGradientFill || b == c.RadialGradientFill || b == c.FocalRadialGradientFill ? this.buildGradientFillDef(a) : b == c.RepeatingBitmapFill || b == c.ClippedBitmapFill || b == c.NonSmoothedRepeatingBitmapFill || b == c.NonSmoothedClippedBitmapFill ? this.buildBitmapFillDef(a) : null
},
buildGradientFillDef: function (a) {
var b = new fljs.swf.def.GradientFillDef,
c = [];
if (a.FillStyleType == fljs.swf.FillStyleTypes.LinearGradientFill) {
b.create("linearGradient");
c.push([null, "x1", -819.2], [null, "x2", 819.2])
} else {
b.create("radialGradient");
c.push([null, "cx", 0], [null, "cy", 0], [null, "r", 819.2])
}
c.push([null, "gradientUnits", "userSpaceOnUse"]);
c.push([null, "gradientTransform", this.utils.toSvgMatrixString(a.GradientMatrix)]);
var d, e = fljs.swf.SpreadMethods;
switch (a.Gradient.SpreadMode) {
case e.Pad:
d = "pad";
break;
case e.Reflect:
d = "reflect";
break;
case e.Repeat:
d = "repeat";
break
}
c.push([null, "spreadMethod", d]);
var f;
d = fljs.swf.InterpolationMethods;
switch (a.Gradient.InterpolationMode) {
case d.LinearRgb:
f = "linearRGB";
break;
case d.Rgb:
f = "rgb";
break
}
c.push([null, "color-interpolation", f]);
a = a.Gradient.GradientRecords;
for (var g in a) {
f = a[g];
d = new fljs.swf.def.GradientFillStopDef;
d.setColor(this.rgbaToColor(f.Color));
e = [];
e.push([null, "offset",
f.Ratio / 255]);
d.element.sets(e);
d.element.update();
b.addStop(d)
}
b.element.sets(c);
b.define();
return b
},
buildBitmapFillDef: function (a) {
var b = new fljs.swf.def.BitmapFillDef;
if (!b.setBitmapId(a.BitmapId)) {
b.define();
return b
}
var c = [];
c.push([null, "patternUnits", "userSpaceOnUse"], [null, "x", 0], [null, "y", 0], [null, "width", b.bitmap.Width], [null, "height", b.bitmap.Height]);
var d = [];
if (a = a.BitmapMatrix) {
a = this.utils.toMatrix(a);
a.a /= 20;
a.b /= 20;
a.c /= 20;
a.d /= 20;
d.push("translate(" + [a.tx, a.ty] + ")");
a.tx = 0;
a.ty =
0;
d.push(a.__toSvgString())
}
c.push([null, "patternTransform", d.toString()]);
b.element.sets(c);
b.define();
return b
},
rgbaToColor: function (a) {
var b = (a.Red << 24) + (a.Green << 16) + (a.Blue << 8);
b |= typeof a.Alpha != "undefined" ? a.Alpha : 255;
return b
}
});
fljs.swf.tag.DefineShape = function () {};
fljs.addMethods(fljs.swf.tag.DefineShape, {
read: function (a) {
a.beginContext(fljs.swf.tag.DefineShape);
this.defId = this.ShapeId = a.readUI16();
this.ShapeBounds = a.readRECT();
a.stream.align();
this.Shapes = a.readSHAPEWITHSTYLE();
a.endContext()
},
waitForBitmaps: function () {
var a = fljs.Player.getInstance();
this.bitmapIds = this.findBitmaps(this);
this.waiting = 0;
var b = fljs.Player.getInstance().mainTimeline.resources,
c = [];
for (var d in this.bitmapIds) if (b.waiting(d)) {
this.waiting += 1;
b.listen(d, fljs.bind(this.onLoad, this, a))
} else c.push(d);
for (var e in c) delete this.bitmapIds[c[e]]
},
onLoad: function (a, b) {
if (this.bitmapIds[b]) {
delete this.bitmapIds[b];
this.waiting -= 1
}
this.waiting == 0 && this.evaluate(a)
},
evaluate: function (a) {
this.bitmapIds || this.waitForBitmaps();
if (!(this.waiting > 0)) {
this.def = (new fljs.swf.build.ShapeBuilder).build(this);
a.addDefinition(this, this.ShapeId)
}
},
findBitmaps: function (a) {
var b = {};
this.findBitmapsForStyles(b, a.Shapes.FillStyles);
a = a.Shapes.ShapeRecords;
for (var c in a) {
var d = a[c];
d.type == "NONEDGE" && d.StateNewStyles && this.findBitmapsForStyles(b, d.FillStyles)
}
return b
},
findBitmapsForStyles: function (a, b) {
var c = fljs.swf.FillStyleTypes;
for (var d in b) {
var e = b[d],
f = e.FillStyleType;
if (f == c.RepeatingBitmapFill || f == c.ClippedBitmapFill || f == c.NonSmoothedRepeatingBitmapFill || f == c.NonSmoothedClippedBitmapFill) a[e.BitmapId] = true
}
},
build: function (a, b, c) {
a = new flash.display.Shape;
a.useTag(this, b, c);
return a
}
});
fljs.dom = {};
fljs.dom.Namespace = {
Svg: "http://www.w3.org/2000/svg",
Xlink: "http://www.w3.org/1999/xlink"
};
fljs.dom.Element = function (a) {
this.element = a;
this.changes = []
};
fljs.addMethods(fljs.dom.Element, {
create: function (a, b) {
if (arguments.length == 1) {
b = a;
this.element = document.createElement(b)
} else this.element = document.createElementNS(a, b);
this.changes = []
},
set: function (a, b, c) {
if (arguments.length == 2) {
c = b;
b = a;
this.changes.push([b, c])
} else this.changes.push([a, b, c])
},
sets: function (a) {
this.changes.push.apply(this.changes, a)
},
update: function () {
var a = this.element,
b = this.changes;
for (var c in b) {
var d = b[c];
d.length == 2 ? a.setAttribute(d[0], d[1]) : a.setAttributeNS(d[0], d[1], d[2])
}
this.changes = []
},
append: function (a) {
this.element.appendChild(a.element)
},
appendText: function (a) {
this.element.appendChild(document.createTextNode(a))
},
clone: function (a) {
var b = new fljs.dom.Element;
b.element = this.element.cloneNode(a);
b.changes = [];
return b
},
remove: function (a) {
this.element.removeChild(a.element)
},
getElement: function () {
return this.element
}
});
fljs.swf.build.FontBuilder = function (a, b) {
this.tag = a;
this.player = b
};
fljs.addMethods(fljs.swf.build.FontBuilder, {
buildDef: function () {
var a = this.buildGlyphPaths();
return this.player.renderTextAsGlyphs ? this.buildFontDef(a) : this.buildShapeDef(a)
},
buildFontDef: function (a) {
var b = this.tag,
c = this.player.element.getElement().ownerDocument,
d = c.createElementNS("http://www.w3.org/2000/svg", "font"),
e = c.createElementNS("http://www.w3.org/2000/svg", "font-face");
e.setAttributeNS(null, "font-family", "font-" + b.FontId);
e.setAttributeNS(null, "units-per-em", 51.2);
d.appendChild(e);
for (var f in a) {
e =
c.createElementNS("http://www.w3.org/2000/svg", "glyph");
e.setAttributeNS(null, "unicode", String.fromCharCode(b.CodeTable[f]));
b.FontAdvanceTable && e.setAttributeNS(null, "horiz-adv-x", b.FontAdvanceTable[f] / 20);
e.setAttributeNS(null, "d", a[f]);
d.appendChild(e)
}
return [{
element: d
}]
},
buildShapeDef: function (a) {
var b = this.tag,
c = [];
for (var d in a) {
var e = new fljs.dom.Element;
e.create(fljs.dom.Namespace.Svg, "path");
var f = ["font", b.FontId, b.FontFlagsBold, b.FontFlagsItalic, b.CodeTable[d]].join("-");
if (document.getElementById(f)) rar.rar = rar;
e.sets([["id", f], ["d", a[d]]]);
e.update();
c.push(e)
}
return c
},
buildGlyphPaths: function () {
for (var a = [], b = this.tag.GlyphShapeTable, c = 0, d = b.length; c < d; c++) {
var e = this.buildPath(this.buildGlyph(b[c]));
a.push(e)
}
return a
},
buildGlyph: function (a) {
var b = 0,
c = 0,
d = 0,
e = 0,
f = 0,
g = 0;
a = a.ShapeRecords;
var j = [],
h = [],
m = 1;
if (this.tag instanceof fljs.swf.tag.DefineFont3) m = 20;
var k = function (n) {
return Math.round(n * 100) / 100 / m
};
for (var l in a) {
g = a[l];
switch (g.type) {
case "STRAIGHT":
f = b + g.DeltaX;
g = c + g.DeltaY;
h.push({
x1: k(b),
y1: k(c),
x2: k(f),
y2: k(g)
});
b = f;
c = g;
break;
case "CURVED":
d = b + g.ControlDeltaX;
e = c + g.ControlDeltaY;
f = d + g.AnchorDeltaX;
g = e + g.AnchorDeltaY;
h.push({
x1: k(b),
y1: k(c),
cx: k(d),
cy: k(e),
x2: k(f),
y2: k(g)
});
b = f;
c = g;
break;
case "NONEDGE":
if (g.StateMoveTo) {
h.length && j.push(h);
b = g.MoveDeltaX;
c = g.MoveDeltaY;
h = []
}
break
}
}
h.length && j.push(h);
return j
},
buildPath: function (a) {
var b = [],
c = this.player.renderTextAsGlyphs ? -1 : 1,
d;
for (var e in a) {
var f = a[e];
b.push("M", f[0].x1, f[0].y1 * c);
for (var g in f) {
d = f[g];
typeof d.cx == "undefined" ? b.push("L", d.x2, d.y2 * c) : b.push("Q", d.cx, d.cy * c, d.x2, d.y2 * c)
}
}
b.length == 0 && b.push("M", 0, 0);
return b.join(" ")
}
});
fljs.swf.build.FontBuilder.id = 1;
fljs.swf.tag.DefineFont = function () {};
fljs.addMethods(fljs.swf.tag.DefineFont, {
read: function (a) {
this.FontId = a.readUI16();
this.OffsetTable = [a.readUI16()];
var b = this.OffsetTable[0] / 2;
this.NumGlyphs = b;
for (var c = 1; c < b; c++) this.OffsetTable.push(a.readUI16());
this.GlyphShapeTable = [];
for (c = 0; c < b; c++) this.GlyphShapeTable.push(a.readSHAPE())
},
evaluate: function (a) {
this.CodeTable = [];
for (var b in this.GlyphShapeTable) this.CodeTable.push(b);
this.FontName = "font-no-info-" + this.FontId;
this.FontFlagsItalic = this.FontFlagsBold = false;
a.fontsWithoutInfo[this.FontId] =
this;
b = (new fljs.swf.build.FontBuilder(this, a)).buildDef();
a.defineFont2(this.FontId, this.GlyphShapeTable, b, this.FontName, this.FontFlagsBold, this.FontFlagsItalic, this.CodeTable)
}
});
fljs.swf.tag.SetBackgroundColor = function () {};
fljs.addMethods(fljs.swf.tag.SetBackgroundColor, {
read: function (a) {
this.BackgroundColor = a.readRGB()
},
evaluate: function (a) {
a.stage.setBackgroundColor_((this.BackgroundColor.Red << 16) + (this.BackgroundColor.Green << 8) + this.BackgroundColor.Blue)
}
});
fljs.swf.tag.DoAbc = function () {};
fljs.addMethods(fljs.swf.tag.DoAbc, {
read: function (a, b) {
var c = a.stream.byteIndex;
this.Flags = a.readUI32();
this.Name = a.readString();
b = b.TagLength - (a.stream.byteIndex - c);
c = [];
for (var d = 0; d < b; d++) c.push(String.fromCharCode(a.readUB()));
this.AbcData = c.join("")
},
evaluate: function () {}
});
fljs.swf.tag.SoundStreamBlock = function () {};
fljs.addMethods(fljs.swf.tag.SoundStreamBlock, {
read: function (a, b) {
this.SampleCount = a.readUI16();
this.Mp3SoundData = a.readMp3SoundData(b.TagLength - 2)
},
evaluate: function (a, b, c, d) {
if (d == a.mainTimeline) if (b = d.audioStream) {
b.shouldBuffer() && b.buffer();
c = a.mainTimeline.currentFrameIndex_;
if (!b.playing && b.frameShouldPlay(c)) {
b.playFrame(c);
a.sync.start(c)
}
}
},
duration: function () {
var a = 0;
for (var b in this.Mp3SoundData.Mp3Frames) {
var c = this.Mp3SoundData.Mp3Frames[b],
d;
d = c.MpegVersion == 3 ? 1152 : 576;
var e = {
0: 11025,
1: 12E3,
2: 8E3
}[c.SamplingRate];
e *= {
0: 1,
2: 2,
3: 4
}[c.MpegVersion];
a += 1E3 * d / e / (c.ChannelMode == 3 ? 1 : 2)
}
return a
}
});
fljs.swf.SwfStreamingSoundReader = function (a, b) {
this.stream = new fljs.swf.SwfStream(new fljs.swf.StringStream(a));
this.container = b;
b.soundStream = this;
this.tagMap = {
19: fljs.swf.tag.SoundStreamBlock
};
this.currentTimeOffset = this.currentPlayer = 0;
this.data = [];
this.dataDurations = [];
this.container.needAudio();
for (a = 0; a < 2; a++) {
b = this.container.audio[a];
b.currentTimeOffset = 0;
b.addEventListener("load", fljs.bind(this.onLoadSrc, this, a), true)
}
this.lastBufferAt = null;
this.swfFrames = {};
this.duration = this.swfFrameNum =
0;
this.playing = false;
this.nextTime = null;
this.waitingForLoad = false;
this.dataOffset = 0;
this.player = fljs.Player.getInstance()
};
fljs.addMethods(fljs.swf.SwfStreamingSoundReader, {
controlFrame: function () {},
timeDiff: function (a) {
var b = this.container.audio[this.currentPlayer];
return 1E3 * (b.currentTime + b.currentTimeOffset) - this.swfFrames[a]
},
currentTime: function () {
var a = this.container.audio[this.currentPlayer];
return 1E3 * (a.currentTime + a.currentTimeOffset)
},
play: function (a) {
a = this.swfFrames[a];
if (a == null) a = 0;
a /= 1E3;
this.nextTime = a;
this.playing = true;
if (!this.waitingForLoad) {
var b = this.container.audio[this.currentPlayer];
b.currentTime =
a - b.currentTimeOffset;
b.fljsPlaying = true;
this.player.playing && b.play()
}
},
stop: function () {
this.playing = false;
var a = this.container.audio[this.currentPlayer];
a.fljsPlaying = false;
a.pause()
},
silence: function () {
return ""
},
onLoadSrc: function (a) {
var b = this.container.audio[a],
c = this.container.audio[1 - a];
b.fljsWaiting = false;
if (this.nextTime != null) {
b.currentTime = this.nextTime - b.currentTimeOffset;
this.nextTime = null
} else b.currentTime = c.currentTime + c.currentTimeOffset - b.currentTimeOffset;
if (this.playing) {
b.fljsPlaying =
true;
this.player.playing && b.play()
}
c.fljsPlaying = false;
c.pause();
this.currentPlayer = a;
this.waitingForLoad = false
},
processBlock: function (a, b) {
a = new fljs.swf.StringStream(this.stream.stream.buffer);
a.byteIndex = b.Mp3SoundData.byteIndex;
a = a.readBytes(b.Mp3SoundData.byteCount).join("");
this.data.push(String(a));
if (b.SampleCount) {
a = b.duration();
b = a * (b.Mp3SoundData.SeekSamples / b.SampleCount);
this.swfFrames[this.swfFrameNum] = this.duration + b;
this.sync && this.sync.setFrameTime(this.swfFrameNum, this.duration + b);
this.duration += a
} else a = 0;
this.dataDurations.push(a / 1E3);
this.blocks += 1;
return this.blocks < fljs.swf.SwfStreamingSoundReader.bufferBlocks
},
buffer: function () {
this.blocks = 0;
this.readTags(fljs.bind(this.processBlock, this), this.stream.stream.byteIndex);
for (var a = this.container.audio[this.currentPlayer], b = this.container.audio[1 - this.currentPlayer]; this.currentTimeOffset + this.dataDurations[this.dataOffset] < a.currentTime + a.currentTimeOffset;) {
this.currentTimeOffset += this.dataDurations[this.dataOffset];
this.dataOffset += 1
}
a = "data:audio/mpeg;base64," + btoa(this.data.slice(this.dataOffset).join(""));
b.currentTimeOffset = this.currentTimeOffset;
b.setAttribute("src", a);
this.waitingForLoad = true;
b.fljsWaiting = true;
b.load();
this.lastBufferAt = fljs.now()
},
readTags: function (a, b) {
var c = fljs.console("soundstream");
if (b) this.stream.stream.seek(b);
else this.stream.header = this.stream.readSwfHeader();
for (var d, e; this.stream.hasMore();) {
d = this.stream.readRecordHeader();
e = this.tagMap[d.TagType];
b = this.stream.stream.byteIndex;
if (e) {
e = new e;
e.read(this.stream, d, this, a, fljs.Player.getInstance().stage);
if (!a(d, e)) return
} else {
this.stream.skipBytes(d.TagLength);
if (d.TagType == 1) this.swfFrameNum += 1
}
if (this.stream.stream.byteIndex != b + d.TagLength) {
c.info("expected " + (b + d.TagLength) + " but got " + this.stream.stream.byteIndex);
return
}
}
}
});
fljs.swf.SwfStreamingSoundReader.rebufferDuration = 9E4;
fljs.swf.SwfStreamingSoundReader.bufferBlocks = 4500;
fljs.swf.tag.SoundStreamHead = function () {};
fljs.addMethods(fljs.swf.tag.SoundStreamHead, {
read: function (a) {
a.readUB(4);
this.PlaybackSoundRate = a.readUB(2);
this.PlaybackSoundSize = a.readUB(1);
this.PlaybackSoundType = a.readUB(1);
this.StreamSoundCompression = a.readUB(4);
this.StreamSoundRate = a.readUB(2);
this.StreamSoundSize = a.readUB(1);
this.StreamSoundType = a.readUB(1);
this.StreamSoundSampleCount = a.readUI16();
if (this.StreamSoundCompression == 2) this.LatencySeek = a.readSI16()
},
evaluate: function (a, b, c, d) {
if (!this.processed) {
d.soundStreamHead = this;
if (d == a.mainTimeline) {
d.audioStream = fljs.agent.browser == "Firefox" ? new fljs.player.ExtAudioStream(a, d, "audio/" + a.name + "-" + (d.def ? d.def.defId : "main") + ".wav") : new fljs.player.SwfAudioStream(a, d);
a.sync = new fljs.player.AudioSync(a.header.FrameRate);
a.sync.setAudio(d.audioStream);
d.audioStream.buffer()
}
this.processed = true
}
}
});
fljs.swf.tag.DefineFont2 = function () {};
fljs.addMethods(fljs.swf.tag.DefineFont2, {
read: function (a) {
var b;
this.FontId = a.readUI16();
this.FontFlagsHasLayout = a.readUB(1);
this.FontFlagsShiftJIS = a.readUB(1);
this.FontFlagsSmallText = a.readUB(1);
this.FontFlagsANSI = a.readUB(1);
this.FontFlagsWideOffsets = a.readUB(1);
this.FontFlagsWideCodes = a.readUB(1);
a.FontFlagsWideCodes = this.FontFlagsWideCodes;
this.FontFlagsItalic = a.readUB(1);
this.FontFlagsBold = a.readUB(1);
this.LanguageCode = a.readLangCode();
this.FontNameLen = a.readUI8();
var c = [];
for (b = 0; b < this.FontNameLen; b++) c.push(String.fromCharCode(a.readUI8()));
this.FontName = c.join("");
this.NumGlyphs = a.readUI16();
this.OffsetTable = [];
if (this.FontFlagsWideOffsets) {
for (b = 0; b < this.NumGlyphs; b++) this.OffsetTable.push(a.readUI32());
this.CodeTableOffset = a.readUI32()
} else {
for (b = 0; b < this.NumGlyphs; b++) this.OffsetTable.push(a.readUI16());
this.CodeTableOffset = a.readUI16()
}
this.GlyphShapeTable = [];
for (b = 0; b < this.NumGlyphs; b++) this.GlyphShapeTable.push(a.readShape());
this.CodeTable = [];
if (this.FontFlagsWideCodes) for (b = 0; b < this.NumGlyphs; b++) this.CodeTable.push(a.readUI16());
else for (b = 0; b < this.NumGlyphs; b++) this.CodeTable.push(a.readUI8());
if (this.FontFlagsHasLayout) {
this.FontAscent = a.readSI16();
this.FontDescent = a.readSI16();
this.FontLeading = a.readSI16();
this.FontAdvanceTable = [];
for (b = 0; b < this.NumGlyphs; b++) this.FontAdvanceTable.push(a.readSI16());
this.FontBoundsTable = [];
for (b = 0; b < this.NumGlyphs; b++) {
this.FontBoundsTable.push(a.readRECT());
a.stream.align()
}
this.KerningCount = a.readUI16();
this.FontKerningTable = [];
for (b = 0; b < this.KerningCount; b++) this.FontKerningTable.push(a.readKerningRecord())
}
},
evaluate: function (a) {
var b = (new fljs.swf.build.FontBuilder(this, a)).buildDef();
a.defineFont2(this.FontId, this.GlyphShapeTable.length, b, this.FontName, this.FontFlagsBold, this.FontFlagsItalic, this.CodeTable, this)
}
});
flash.text = {};
flash.text.TextFormatAlign = function () {};
fljs.addConstants(flash.text.TextFormatAlign, {
CENTER: "center",
JUSTIFY: "justify",
LEFT: "left",
RIGHT: "right"
});
flash.text.TextFormat = function (a, b, c, d, e, f, g, j, h, m, k, l, n, p) {
if (typeof a == "undefined") a = null;
this.font = a;
if (typeof b == "undefined") b = null;
this.size = b;
if (typeof c == "undefined") c = null;
this.color = c;
if (typeof d == "undefined") d = null;
this.bold = d;
if (typeof e == "undefined") e = null;
this.italic = e;
if (typeof f == "undefined") f = null;
this.underline = f;
if (typeof g == "undefined") g = null;
this.url = g;
if (typeof j == "undefined") j = null;
this.target = j;
if (typeof h == "undefined") h = flash.text.TextFormatAlign.LEFT;
this.align = h;
if (typeof m == "undefined") m = null;
this.leftMargin = m;
if (typeof k == "undefined") k = null;
this.rightMargin = k;
if (typeof l == "undefined") l = null;
this.indent = l;
if (typeof n == "undefined") n = null;
this.leading = n;
if (typeof p == "undefined") p = 1;
this.alpha = p
};
flash.text.TextField = function () {
flash.display.InteractiveObject.call(this);
var a = this.element_ = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "g");
this._clipElement.element.appendChild(this.element_.getElement());
this.font_ = {
family: "times",
size: 12
};
this.fill_ = {
color: 0
};
this.textFormat_ = new flash.text.TextFormat(this.font_.family, this.font_.size, this.fill_.color, false, false, false, null, null, flash.text.TextFormatAlign.LEFT, 0, 0, 0, 0);
if (fljs.Player.getInstance().renderTextAsGlyphs) {
a = Math.round(this.font_.size * 0.85);
var b = Math.round(0 - this.font_.size / 2 + a);
a = this._text = this.text_ = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "text");
a.sets([[null, "fill", this.__colorToSvgString(this.font_.color)], [null, "font-family", this.font_.family], [null, "font-size", this.font_.size], [null, "font-family", this.font_.family], [null, "x", 0], [null, "y", b]]);
a.update();
this.element_.append(a)
} else {
a = this._text = new fljs.dom.Element;
a.create(fljs.dom.Namespace.Svg, "g");
a.update();
this.element_.append(a)
}
this._textContent = ""
};
fljs.inherits(flash.text.TextField, flash.display.InteractiveObject);
fljs.addMethods(flash.text.TextField, {
setTextMatrix: function (a) {
this._textMatrix = a;
this._text.set(null, 'transform', a.__toSvgString());
this._text.update()
},
__setSpans: function (a) {
var b = [];
this.spans = [];
if (fljs.Player.getInstance().renderTextAsGlyphs) {
var c = this.text_.getElement().ownerDocument;
for (var d in a) {
var e = a[d],
f = c.createElementNS("http://www.w3.org/2000/svg", "tspan"),
g = e.format.indent,
j = [g];
for (var h in e.advances) {
g += e.advances[h];
j.push(g)
}
f.appendChild(c.createTextNode(e.text));
f.setAttributeNS(null, "x", j.join(" "));
f.setAttributeNS(null, "y", e.format.leading);
f.setAttributeNS(null, "font-size", e.format.size);
f.setAttributeNS(null, "fill", this.__colorToSvgString(e.format.color));
f.setAttributeNS(null, "fill-opacity", this.textOpacityWithXform(e.format.alpha));
this.text_.getElement().appendChild(f);
this.spans.push({
def: e,
element: f
});
b.push(e.text)
}
} else {
fljs.Player.getInstance();
c = this._text;
for (d in a) {
e = a[d];
f = e.format;
j = e.advances;
var m = new fljs.dom.Element;
m.create(fljs.dom.Namespace.Svg, "g");
m.sets([["transform", ["translate(", f.indent, ",", f.leading, ")"].join("")], ["fill", this.__colorToSvgString(f.color)],
["fill-opacity", this.opacityWithXform(f.alpha)]]);
m.update();
h = g = 0;
for (var k = e.text.length; h < k; h++) {
var l = new fljs.dom.Element;
l.create(fljs.dom.Namespace.Svg, "use");
var n = ["font", f.fontid, f.bold, f.italic, e.text.charCodeAt(h)].join("-");
l.sets([[fljs.dom.Namespace.Xlink, "xlink:href", "#" + n], ["transform", ["translate(", g, ")scale(", f.size * 20 / 1024, ")"].join("")]]);
l.update();
m.append(l);
g += j[h]
}
c.append(m);
this.spans.push({
def: e,
element: m
});
b.push(e.text)
}
}
this._textContent = b.join("")
},
__colorToSvgString: function (a) {
var b =
a >> 16 & 255,
c = a >> 8 & 255;
a = a & 255;
var d = this.getTransform().getConcatenatedColorTransform();
if (!d.__default) {
b = Math.max(0, Math.min(255, Math.round(b * d.redMultiplier + d.redOffset)));
c = Math.max(0, Math.min(255, Math.round(c * d.greenMultiplier + d.greenOffset)));
a = Math.max(0, Math.min(255, Math.round(a * d.blueMultiplier + d.blueOffset)))
}
return "rgb(" + [b, c, a] + ")"
},
opacityWithXform: function (a) {
return a
},
textOpacityWithXform: function (a) {
var b = this.getTransform().getConcatenatedColorTransform();
return b.__default ? a : Math.max(0, Math.min(255, Math.round(a * 255 * b.alphaMultiplier + b.alphaOffset))) / 255
},
__setColorTransform: function (a) {
if (fljs.Player.getInstance().renderTextAsGlyphs) for (var b in this.spans) {
var c = this.spans[b];
a = c.def;
c = c.element;
c.setAttributeNS(null, "color", this.__colorToSvgString(a.format.color));
c.setAttributeNS(null, "fill-opacity", this.textOpacityWithXform(a.format.alpha))
} else {
fljs.base(this, "__setColorTransform", a);
for (b in this.spans) {
c = this.spans[b];
a = c.def;
c = c.element;
c.sets([[null, "color", this.__colorToSvgString(a.format.color)]]);
c.update()
}
}
},
setHeight: function (a) {
this.height_ = a
},
setWidth: function (a) {
this.width_ = a
},
getDefaultTextFormat: function () {
return this.textFormat_
},
setDefaultTextFormat: function (a) {
if (fljs.Player.getInstance().renderTextAsGlyphs) {
var b = this.textFormat_;
this.textFormat_ = a;
if (b.align != this.textFormat_.align) switch (this.textFormat_.align) {
case flash.text.TextFormatAlign.LEFT:
this.text_.getElement().setAttribute("x", this.x);
this.text_.getElement().setAttribute("text-anchor", "start");
break;
case flash.text.TextFormatAlign.CENTER:
this.text_.getElement().setAttribute("x", this.x + this.width / 2);
this.text_.getElement().setAttribute("text-anchor", "middle");
break;
case flash.text.TextFormatAlign.LEFT:
this.text_.getElement().setAttribute("x", this.x + this.width);
this.text_.getElement().setAttribute("text-anchor", "end");
break;
default:
}
if (b.font != this.textFormat_.font) {
a = fljs.Player.getInstance().lookupFontByStyle(this.textFormat_.font, this.textFormat_.bold, this.textFormat_.italic);
this.text_.getElement().setAttributeNS(null, "font-family", a)
}
if (b.bold != this.textFormat_.bold) {
a =
this.textFormat_.bold ? "bold" : "";
this.text_.getElement().setAttribute("font-weight", a)
}
if (b.italic != this.textFormat_.italic) {
a = this.textFormat_.italic ? "italic" : "";
this.text_.getElement().setAttribute("font-style", a)
}
if (b.color != this.textFormat_.color) {
this.fill_ = {
color: this.textFormat_.color
};
this.text_.set(null, "fill", this.__colorToSvgString(this.fill_.color))
}
if (b.size != this.textFormat_.size) {
this.font_ = {
size: this.textFormat_.size,
family: this.textFormat_.font
};
this.text_.getElement().setAttribute("font-size", this.textFormat_.size)
}
b.alpha != this.textFormat_.alpha && this.text_.getElement().setAttribute("opacity", this.textFormat_.alpha)
}
}
});
fljs.swf.tag.DefineEditText = function () {};
fljs.addMethods(fljs.swf.tag.DefineEditText, {
read: function (a) {
this.CharacterId = a.readUI16();
this.Bounds = a.readRECT();
a.stream.align();
this.HasText = a.readUB(1);
this.WordWrap = a.readUB(1);
this.Multiline = a.readUB(1);
this.Password = a.readUB(1);
this.ReadOnly = a.readUB(1);
this.HasTextColor = a.readUB(1);
this.HasMaxLength = a.readUB(1);
this.HasFont = a.readUB(1);
this.HasFontClass = a.readUB(1);
this.AutoSize = a.readUB(1);
this.HasLayout = a.readUB(1);
this.NoSelect = a.readUB(1);
this.Border = a.readUB(1);
this.WasStatic = a.readUB(1);
this.HTML = a.readUB(1);
this.UseOutlines = a.readUB(1);
if (this.HasFont) this.FontId = a.readUI16();
if (this.HasFontClass) this.FontClass = a.readString();
if (this.HasFont) this.FontHeight = a.readUI16() / a.twipsPerPixel;
if (this.HasTextColor) this.TextColor = a.readRGBA();
if (this.HasMaxLength) this.MaxLength = a.readUI16();
if (this.HasLayout) {
this.Align = a.readUI8();
this.LeftMargin = a.readUI16();
this.RightMargin = a.readUI16();
this.Indent = a.readUI16();
this.Leading = a.readUI16()
}
this.VariableName = a.readString();
if (this.HasText) this.InitialText = a.readString()
},
evaluate: function (a) {
a.addDefinition(this, this.CharacterId)
},
_build: function (a) {
a = a.element.getElement().ownerDocument;
var b = a.createElement("text");
b.setAttribute("font-family", "font-" + String(this.FontId));
b.setAttribute("font-size", this.FontHeight);
var c = this.TextColor,
d = 0;
d += c.Red << 16;
d += c.Green << 8;
d += c.Blue;
b.setAttribute("fill", d);
var e, f;
if (this.Align) {
if (this.Align == 1) {
e = this.Bounds.Xmax;
f = "end"
}
} else {
e = this.Bounds.Xmin;
f = "start"
}
b.setAttribute("x", e);
b.setAttribute("text-anchor", f);
b.setAttribute("y", this.Bounds.Ymax);
b.appendChild(a.createTextNode(this.InitialText ? this.InitialText : ""));
return b
},
build: function (a, b) {
return this._buildTextField(a, b)
},
_buildTextField: function (a, b) {
var c = new flash.text.TextField;
b && c.getTransform().setColorTransform(b);
c.text = this.InitialText;
c.x = this.Bounds.Xmin;
c.y = this.Bounds.Ymin;
c.setWidth(this.Bounds.Xmax - this.Bounds.Xmin);
c.setHeight(this.Bounds.Ymax - this.Bounds.Ymin);
b = new flash.text.TextFormat;
switch (this.Align) {
case 0:
b.align = flash.text.TextFormatAlign.LEFT;
break;
case 1:
b.align = flash.text.TextFormatAlign.RIGHT;
break;
case 2:
b.align = flash.text.TextFormatAlign.CENTER;
break;
case 3:
b.align = flash.text.TextFormatAlign.JUSTIFY;
break
}
if (a = a.fonts2[this.FontId]) {
b.bold = a.bold;
b.italic = a.italic;
b.font = a.name
}
a = this.TextColor;
var d = 0;
d += a.Red << 16;
d += a.Green << 8;
d += a.Blue;
b.color = d;
b.leading = this.Leading;
b.leftMargin = this.LeftMargin;
b.rightMargin = this.RightMargin;
b.indent = this.Indent;
b.size = this.FontHeight;
c.setDefaultTextFormat(b);
return c
}
});
fljs.swf.tag.RemoveObject2 = function () {};
fljs.addMethods(fljs.swf.tag.RemoveObject2, {
read: function (a) {
this.Depth = a.readUI16()
},
evaluate: function (a, b, c, d) {
d.removeChildAt(this.Depth)
}
});
fljs.swf.build.JpegBuilder = function () {};
fljs.addMethods(fljs.swf.build.JpegBuilder, {
parseJpeg: function (a, b, c, d) {
b = String(b.readBytes(c).join(""));
var e = new fljs.swf.BigEndianStringStream(b),
f, g, j = fljs.Player.getInstance(),
h;
if (e.nextUShort() == 65497) {
h = d && j.jpegTables ? 6 : 4;
e.nextUShort();
e.nextUShort()
} else h = d && j.jpegTables ? 2 : 0;
for (var m = 0; e.byteIndex < c;) {
f = e.nextUShort();
g = e.nextUShort();
if (f == 65472) {
e.nextUByte();
a.Height = e.nextUShort();
a.Width = e.nextUShort();
break
}
if (f == 65497) m = e.byteIndex - 6;
else e.skipBytes(g - 2)
}
if (m) b = b.substr(0, m) + b.substr(m + 6);
if (h) b = b.substr(h);
a.DataUri = "data:image/jpeg;base64," + btoa((d && j.jpegTables ? j.jpegTables : "") + b)
},
parseJpegTables: function (a, b, c) {
b = String(b.readBytes(c).join(""));
var d = new fljs.swf.BigEndianStringStream(b),
e = 0;
if (d.nextUShort() == 65497) {
e = 4;
d.nextUShort();
d.nextUShort()
}
a.JpegTables = b.substr(e, c - e - 2)
}
});
fljs.swf.tag.DefineBitsJPEG2 = function () {};
fljs.addMethods(fljs.swf.tag.DefineBitsJPEG2, {
read: function (a, b) {
this.CharacterId = a.readUI16();
b = b.TagLength - 2;
(new fljs.swf.build.JpegBuilder).parseJpeg(this, a, b, true)
},
evaluate: function (a) {
this.defId = "image" + this.CharacterId;
a.addDefinition(this, this.CharacterId);
a = new fljs.swf.def.BitmapDef;
a.setCharaId(this.defId);
a.element.sets([[fljs.dom.Namespace.Xlink, "xlink:href", this.DataUri], [null, "x", 0], [null, "y", 0], [null, "width", this.Width], [null, "height", this.Height]]);
a.define();
this.def = a
}
});
flash.display.Sprite = function () {
flash.display.DisplayObjectContainer.call(this)
};
fljs.inherits(flash.display.Sprite, flash.display.DisplayObjectContainer);
fljs.addMethods(flash.display.Sprite, {
startDrag: function () {},
stopDrag: function () {},
getGraphics: function () {
return this.graphics_
}
});
flash.display.Scene = function () {};
flash.ui = {};
flash.ui.Keyboard = function () {};
fljs.addStaticMethods(flash.ui.Keyboard, {
isAccessible: function () {}
});
fljs.addConstants(flash.ui.Keyboard, {
BACKSPACE: 8,
CAPS_LOCK: 20,
CONTROL: 17,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
F1: 112,
F10: 121,
F11: 122,
F12: 123,
F13: 124,
F14: 125,
F15: 126,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
HOME: 36,
INSERT: 45,
LEFT: 37,
NUMPAD_0: 96,
NUMPAD_1: 97,
NUMPAD_2: 98,
NUMPAD_3: 99,
NUMPAD_4: 100,
NUMPAD_5: 101,
NUMPAD_6: 102,
NUMPAD_7: 103,
NUMPAD_8: 104,
NUMPAD_9: 105,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
RIGHT: 39,
SHIFT: 16,
SPACE: 32,
TAB: 9,
UP: 38
});
fljs.swf.AudioStreamReader = function (a, b) {
this.player = a;
this.delegate = b;
this.reader = new fljs.swf.TagReader(a.parser.reader.stream.stream.buffer);
this.reader.readSwfHeader()
};
fljs.addMethods(fljs.swf.AudioStreamReader, {
hasMore: function () {
return this.reader.stream.hasMore()
},
read: function (a) {
for (var b = 0, c = this.delegate, d = this.reader, e = [0]; d.stream.hasMore();) {
var f = d.readTagHeader();
switch (f.tagClass()) {
case fljs.swf.tag.SoundStreamBlock:
f = d.readTag(f);
c.onSoundStreamBlockTag(f, null, e[0]);
b++;
if (b == a) return;
break;
case fljs.swf.tag.ShowFrame:
f = d.readTag(f);
c.onShowFrameTag(f, null, e[0]);
e[0] += 1;
break;
default:
d.skipTag(f);
c.onUnknownTag && c.onUnknownTag(f, null, e[0]);
break
}
}
}
});
fljs.player = {};
fljs.player.ResourceManager = function () {
this.frames = {};
this.res = {};
this.streams = {};
this.listeners = {}
};
fljs.addMethods(fljs.player.ResourceManager, {
addToFrame: function (a, b) {
this.frames[b] || (this.frames[b] = {});
this.frames[b][a] = true;
this.res[a] = b
},
remove: function (a) {
if (this.listeners[a]) for (var b in this.listeners[a]) this.listeners[a][b](a);
b = this.res[a];
delete this.listeners[a];
delete this.frames[b][a];
delete this.res[a]
},
addStream: function (a) {
this.streams[a.id] = a
},
frameReady: function (a) {
for (var b = 0; b <= a; b++) {
var c = this.frames[a];
if (c) for (var d in c) return false
}
for (b in this.streams) if (!this.streams[b].frameReady(a)) return false;
return true
},
listen: function (a, b) {
var c = this.listeners[a];
c || (c = this.listeners[a] = []);
c.push(b)
},
waiting: function (a) {
return a in this.res
},
newId: function () {
return fljs.player.ResourceManager.id++
}
});
fljs.player.ResourceManager.id = 1;
fljs.player.ExtAudioStream = function (a, b, c) {
this.id = b.resources.newId();
b.resources.addStream(this);
b = this.audio = a.allocAudio();
b.addEventListener("canplaythrough", fljs.bind(this.onAudioLoad, this), true);
b.setAttribute("src", c);
b.load();
this.frames = {};
this.playing = false;
this.audioStreamReader = new fljs.swf.AudioStreamReader(a, this);
this.duration = 0;
this.maxFrame = -1
};
fljs.addMethods(fljs.player.ExtAudioStream, {
pingLoad: function () {},
frameReady: function (a) {
if (this.maxFrame < a) return false;
if (typeof this.frames[a] != "undefined") return true;
else {
for (a = a; a > 0 && typeof this.frames[a] == "undefined";) a--;
return a == 0 ? true : this.frameReady(a)
}
},
frameShouldPlay: function (a) {
for (a = a; a > 0;) {
if (a in this.frames) return !!this.frames[a];
a--
}
return false
},
setFrameDuration: function (a, b) {
this.frames[a] = b
},
onAudioLoad: function () {
fljs.console("audio").info("onAudioLoad: " + this.audio.readyState + ", " + this.audio.duration);
if (!this.started && this.playing) {
this.audio.currentTime = this.frames[this.frame];
this.audio.play()
}
this.started = true
},
playFrame: function (a) {
fljs.console("audio").info("playFrame:" + this.audio.readyState);
if (this.audio.readyState >= 2) {
this.frame = a;
this.audio.currentTime = this.frames[a];
this.audio.play();
this.started = true
}
this.playing = true
},
pause: function () {
this.audio.pause();
this.playing = false
},
controlsFrame: function () {},
currentTime: function () {
return this.audio.currentTime * 1E3
},
setSync: function (a) {
this.sync = a
},
shouldBuffer: function () {
var a = fljs.now() - this.lastBufferAt;
return !this.lastBufferAt || a > fljs.swf.SwfStreamingSoundReader.rebufferDuration
},
buffer: function () {
var a = this.audioStreamReader;
a.hasMore() && a.read(fljs.swf.SwfStreamingSoundReader.bufferBlocks);
this.lastBufferAt = fljs.now()
},
onSoundStreamBlockTag: function (a, b, c) {
this.maxFrame = c;
b = a.duration();
a = this.duration + b * (a.Mp3SoundData.SeekSamples / a.SampleCount);
this.frames[c] = a / 1E3;
this.duration += b;
this.sync.setFrameTime(c, a)
},
onShowFrameTag: function () {}
});
fljs.player.SwfAudioStream = function (a, b) {
this.id = b.resources.newId();
b.resources.addStream(this);
this.player = a;
this.target = b;
this.soundStream = new fljs.swf.SwfStreamingSoundReader(a.parser.reader.stream.stream.buffer, b);
this.playing = false
};
fljs.addMethods(fljs.player.SwfAudioStream, {
pingLoad: function () {},
frameReady: function (a) {
if (typeof this.soundStream.swfFrames[a] != "undefined") return this.soundStream.duration >= this.soundStream.swfFrames[a];
else {
for (a = a; a > 0 && typeof this.soundStream.swfFrames[a] == "undefined";) a--;
return a == 0 ? true : this.frameReady(a)
}
},
frameShouldPlay: function (a) {
for (a = a; a > 0;) {
if (a in this.soundStream.swfFrames) return true;
a--
}
return false
},
setFrameDuration: function () {},
playFrame: function (a) {
this.soundStream.play(a);
this.playing = true
},
pause: function () {
this.soundStream.stop();
this.playing = false
},
controlsFrame: function (a) {
return this.soundStream.controlFrame(a)
},
timeDiff: function (a) {
return this.soundStream.timeDiff(a)
},
currentTime: function () {
return this.soundStream.currentTime()
},
setSync: function (a) {
this.soundStream.sync = a
},
shouldBuffer: function () {
var a = fljs.now() - this.soundStream.lastBufferAt;
return !this.soundStream.lastBufferAt || a > fljs.swf.SwfStreamingSoundReader.rebufferDuration
},
buffer: function () {
this.soundStream.buffer()
}
});
flash.display.MovieClip = function () {
flash.display.Sprite.call(this);
var a = new flash.display.Scene;
a.labels = [];
a.name = "Scene 1";
a.numFrames = 1;
this.frameData_ = [{
scripts: [],
parts: [],
tags: [],
label: "",
repeat: false}];
this.labels_ = {};
this.sceneIndices_ = {};
this.currentSceneIndex_ = 0;
this.scenes_ = [a];
this.currentFrameIndex_ = 0;
this.currentLabel_ = null;
this._enabled = false;
this.totalFrames_ = this.framesLoaded_ = 1;
this.next_ = null;
this.playing_ = true;
this.audio = [];
fljs.Player.getInstance();
this.id = flash.display.MovieClip.id++;
this.element_.getElement().setAttribute("id", "mc" + this.id);
this.__buttonStateDown = this.__buttonStateOver = this.firstFrame = false;
this.resources = new fljs.player.ResourceManager
};
fljs.inherits(flash.display.MovieClip, flash.display.Sprite);
fljs.addMethods(flash.display.MovieClip, {
gotoAndPlay: function (a, b) {
this.gotoAnd_(a, b, true)
},
gotoAndStop: function (a, b) {
this.gotoAnd_(a, b, false)
},
gotoAnd_: function (a, b, c) {
var d, e;
if (typeof a.valueOf() == "string") if (d = this.labels_[a]) {
d = d.frame - 1;
e = 0
} else return;
else if (!b) {
d = a - 1;
if (d == -1) d = 0;
a = this.globalFrameIndexToLocal_(d);
d = a[0];
e = a[1]
}
this.next_ = {
frameIndex: d,
sceneIndex: e,
play: c
};
this.next_.clear = d != this.currentFrameIndex_ + 1
},
globalFrameIndexToLocal_: function (a) {
for (var b = 0; a >= this.scenes_[b].numFrames;) {
a -= this.scenes_[b].numFrames;
b += 1
}
return [a, b]
},
nextFrame: function () {
var a = this.currentFrameIndex_ + 1,
b = this.currentSceneIndex_;
if (a == this.scenes_[this.currentSceneIndex_].numFrames) if (this.totalFrames_ > 1) {
a = 0;
b += 1;
if (b == this.scenes_.length) b = 0
} else {
this.next_ = null;
return
}
this.next_ = {
frameIndex: a,
sceneIndex: b,
play: this.next_ ? this.next_.play : this.playing_
}
},
nextScene: function () {
var a = this.currentSceneIndex_ + 1;
if (a == this.scenes_.length) a = 0;
this.next_ = {
frameIndex: 0,
sceneIndex: a,
play: true
}
},
play: function () {
this.next_ =
this.next_ ? {
frameIndex: this.next_.frameIndex,
sceneIndex: this.next_.sceneIndex,
play: true,
clear: this.next_.clear
} : {
frameIndex: this.currentFrameIndex_,
sceneIndex: this.currentSceneIndex_,
play: true
}
},
prevFrame: function () {
var a = this.currentFrameIndex_ - 1,
b = this.currentSceneIndex_;
if (a == -1) {
b -= 1;
if (b == -1) b = this.scenes_.length - 1;
a = this.scenes_[b].numFrames - 1
}
this.next_ = {
frameIndex: a,
sceneIndex: b,
play: this.next_ ? this.next_.play : this.playing_
}
},
prevScene: function () {
var a = this.currentSceneIndex_ - 1;
if (a == -1) a = this.scenes_.length - 1;
frameIndex = this.scenes_[a].numFrames - 1;
this.next_ = {
frameIndex: frameIndex,
sceneIndex: a,
play: true
}
},
stop: function () {
var a;
if (this.next_) a = this.next_.clear;
this.next_ = {
frameIndex: this.currentFrameIndex_,
sceneIndex: this.currentSceneIndex_,
play: false,
stop: true,
clear: a
}
},
clear: function () {
for (var a in this.displayList_) this.removeChildAt(a)
},
onNewFrame: function () {
if (this.getStage()) if (this.frameReady(this.currentFrameIndex_)) {
this.pendingFrame = false;
var a = this.frameData_[this.currentFrameIndex_];
if (a.label) this.currentLabel_ = a.label;
for (var b = 0; b < a.tags.length; b++) {
var c = a.tags[b];
c[0] && c[0].evaluate(fljs.Player.getInstance(), null, null, this)
}
if (a.parts) for (b in a.parts) this.addChildAt(a.parts[b], b)
} else this.pendingFrame = true
},
onEnterFrame: function () {
var a = false;
if (a = this.pendingFrame ? true : this.pickNextFrame()) {
this.onNewFrame();
if (this.pendingFrame) return
}(a = this._as2Object) && a._onEnterFrame && fljs.Player.getInstance().interpreter.callback(a, a._onEnterFrame)
},
onCreate: function () {
this.next_ = {
frameIndex: 0,
sceneIndex: 0,
play: !this._enabled && this.totalFrames_ > 1
};
this.setCurrentFrame();
this.onNewFrame()
},
setCurrentFrame: function () {
this.updateSoundStream();
this.currentFrameIndex_ = this.next_.frameIndex;
this.currentSceneIndex_ = this.next_.sceneIndex;
this.playing_ = this.next_.play;
this.next_ = null
},
pickNextFrame: function () {
if (this.playing_) if (!this.next_) {
var a = this.currentFrameIndex_ + 1,
b = this.currentSceneIndex_;
if (a == this.scenes_[this.currentSceneIndex_].numFrames) if (a == this.totalFrames_) if (this.totalFrames_ > 1) {
this.clear();
this.next_ = {
frameIndex: 0,
sceneIndex: 0,
play: true
}
} else {
this.playing_ = false;
this.next_ = null
} else this.next_ = {
frameIndex: a,
sceneIndex: b + 1,
play: true
};
else this.next_ = {
frameIndex: a,
sceneIndex: b,
play: this.playing_
}
}
if (this.next_) if (this._enabled) this.next_.play = false;
a = this.next_ && !this.next_.stop && this.next_.frameIndex != this.currentFrameIndex_;
if (this.next_) {
a && this.next_.clear && this.removeChildren();
this.setCurrentFrame();
this.next_ = null
}
return a
},
onEnterFrame_: function (a) {
fljs.console("mc").info("mc#" + this.id + " frame#" + this.currentFrameIndex_);
this.onEnterFrame(a)
},
updateSoundStream: function () {
if (this.audioStream) if (this.next_) if (this.next_.play != this.playing_) if (this.next_.playing) this.audioStream.frameShouldPlay(this.next_.frameIndex) && this.audioStream.playFrame(this.next_.frameIndex);
else this.audioStream.pause();
else this.next_.play && this.next_.frameIndex != this.currentFrameIndex_ + 1 && this.audioStream.frameShouldPlay(this.next_.frameIndex) && this.audioStream.playFrame(this.next_.frameIndex);
else this.audioStream.pause()
},
addFrameScript: function () {
for (var a, b, c = 0; c < arguments.length; c += 2) {
a = arguments[c];
b = this.globalFrameIndexToLocal_(a);
a = b[0];
b = b[1];
this.scenes_[b].frameData_[a].scripts.push(arguments[c + 1])
}
},
updateButtonState: function (a) {
if (this._enabled) {
var b = flash.events.MouseEvent,
c = flash.events.KeyboardEvent,
d, e;
switch (a.type) {
case b.CLICK:
e = d = true;
break;
case b.MOUSE_OVER:
d = true;
e = this.__buttonStateDown;
break;
case b.MOUSE_OUT:
d = false;
e = this.__buttonStateDown;
break;
case b.MOUSE_DOWN:
d = this.__buttonStateOver;
e = true;
break;
case b.MOUSE_UP:
d = this.__buttonStateOver;
e = false;
break;
case c.KEY_DOWN:
d = this.__buttonStateOver;
e = true;
break;
case c.KEY_UP:
d = this.__buttonStateOver;
e = false;
break
}
var f;
if (this.__buttonStateOver != d) f = d ? e ? this.__buttonStateDown ? "CondOutDownToOverDown" : "CondIdleToOverDown" : "CondIdleToOverUp" : e ? "CondOverDownToOutDown" : "CondOverUpToIdle";
else if (this.__buttonStateDown != e) if (e) {
if (d) f = "CondOverUpToOverDown"
} else f = d ? "CondOverDownToOverUp" : "CondOutDownToIdle";
a = d ? e ? "down" : "over" : "up";
this.__buttonStateOver =
d;
this.__buttonStateDown = e;
this.gotoAndStop("_" + a);
if (f) for (var g in this.__buttonActions) {
d = this.__buttonActions[g];
d[f] && fljs.Player.getInstance().doActions(this, d.Actions)
}
}
},
needAudio: function () {
for (var a = fljs.Player.getInstance(), b = 0; b < 2; b++) this.audio[b] = a.allocAudio()
},
frameReady: function (a) {
return this.frameData_[a] && this.frameData_[a].loaded && this.resources.frameReady(a)
},
getEnabled: function () {
return this._enabled
},
setEnabled: function (a) {
this._enabled = !! a
}
});
flash.display.MovieClip.id = 1;
fljs.swf.tag.DefineSprite = function () {};
fljs.addMethods(fljs.swf.tag.DefineSprite, {
read: function (a) {
this.defId = this.SpriteId = a.readUI16();
this.FrameCount = a.readUI16();
this.frameData_ = [{
tags: []}];
this.labels_ = {};
this.framesLoaded_ = 0;
this.totalFrames_ = this.FrameCount
},
evaluate: function (a) {
a.addDefinition(this, this.SpriteId)
},
build: function (a, b) {
a = new flash.display.MovieClip;
a.def = this;
b && a.getTransform().setColorTransform(b);
b = new flash.display.Scene;
b.labels = [];
b.name = "Scene 1";
b.numFrames = this.FrameCount;
a.frameData_ = [];
for (var c = 0; c < this.FrameCount; c++) {
var d = {
scripts: [],
parts: [],
tags: [],
label: ""
};
d.tags = this.frameData_[c].tags;
d.loaded = this.frameData_[c].loaded;
a.frameData_.push(d)
}
a.labels_ = this.labels_;
a.sceneIndices_ = {};
a.currentSceneIndex_ = 0;
a.scenes_ = [b];
a.currentFrameIndex_ = 0;
a.currentLabel_ = null;
a._enabled = false;
a.framesLoaded_ = this.FrameCount;
a.totalFrames_ = this.FrameCount;
a.next_ = null;
a.playing_ = true;
return a
}
});
fljs.swf.tag.DefineSound = function () {};
fljs.addMethods(fljs.swf.tag.DefineSound, {
read: function (a, b) {
this.SoundId = a.readUI16();
this.SoundFormat = a.readUB(4);
this.SoundRate = a.readUB(2);
this.SoundSize = a.readUB(1);
this.SoundType = a.readUB(1);
this.SoundSampleCount = a.readUI32();
this.Mp3SoundData = this.SoundData = a.readMp3SoundData(b.TagLength - 2 - 1 - 4)
},
evaluate: function (a) {
a.sounds[this.SoundId] = this
}
});
fljs.swf.tag.StartSound = function () {};
fljs.addMethods(fljs.swf.tag.StartSound, {
read: function (a) {
this.SoundId = a.readUI16();
this.SoundInfo = a.readSoundInfo()
},
evaluate: function (a, b) {
var c = a.sounds[this.SoundId];
if (!c.player) {
c.player = a.allocAudio();
b = new fljs.swf.StringStream(a.reader.stream.stream.buffer);
b.byteIndex = c.Mp3SoundData.byteIndex;
b = b.readBytes(c.Mp3SoundData.byteCount).join("");
b = "data:audio/mpeg;base64," + btoa(b);
c.player.setAttribute("src", b)
}
var d = c.player;
if (this.SoundInfo.SyncStop) {
d.fljsPlaying = false;
d.pause()
} else if (this.SoundInfo.SyncNoMultiple) {
d.fljsPlaying =
true;
a.playing && d.play()
} else {
d.addEventListener("load", function () {
d.currentTime = 0;
d.fljsPlaying = true;
a.playing && d.play()
}, true);
d.load()
}
}
});
fljs.swf.tag.DefineShape2 = function () {};
fljs.inherits(fljs.swf.tag.DefineShape2, fljs.swf.tag.DefineShape);
fljs.addMethods(fljs.swf.tag.DefineShape2, {
read: function (a, b) {
a.beginContext(fljs.swf.tag.DefineShape2);
a.endByteIndex = a.stream.byteIndex + b.TagLength;
this.ShapeId = a.readUI16();
this.ShapeBounds = a.readRECT();
a.stream.align();
this.Shapes = a.readSHAPEWITHSTYLE();
a.endContext()
}
});
fljs.swf.tag.SoundStreamHead2 = function () {};
fljs.inherits(fljs.swf.tag.SoundStreamHead2, fljs.swf.tag.SoundStreamHead);
fljs.swf.tag.DefineFontInfo = function () {};
fljs.addMethods(fljs.swf.tag.DefineFontInfo, {
read: function (a) {
this.FontId = a.readUI16();
this.FontNameLen = a.readUI8();
var b = [];
for (i = 0; i < this.FontNameLen; i++) b.push(String.fromCharCode(a.readUI8()));
this.FontName = b.join("");
a.readUB(2);
this.FontFlagsSmallText = a.readUB(1);
this.FontFlagsShiftJis = a.readUB(1);
this.FontFlagsAnsi = a.readUB(1);
this.FontFlagsItalic = a.readUB(1);
this.FontFlagsBold = a.readUB(1);
this.FontFlagsWideCodes = a.readUB(1);
b = fljs.Player.getInstance().fontsWithoutInfo[this.FontId];
this.CodeTable = [];
if (this.FontFlagsWideCodes) for (i = 0; i < b.NumGlyphs; i++) this.CodeTable.push(a.readUI16());
else for (i = 0; i < this.NumGlyphs; i++) this.CodeTable.push(a.readUI8());
this.GlyphShapeTable = b.GlyphShapeTable
},
evaluate: function (a) {
var b = (new fljs.swf.build.FontBuilder(this, a)).buildDef();
a.defineFont2(this.FontId, this.GlyphShapeTable.length, b, this.FontName, this.FontFlagsBold, this.FontFlagsItalic, this.CodeTable)
}
});
fljs.swf.tag.DefineText = function () {};
fljs.addMethods(fljs.swf.tag.DefineText, {
read: function (a) {
this.CharacterId = a.readUI16();
this.TextBounds = a.readRECT();
a.stream.align();
this.TextMatrix = a.readMATRIX();
this.GlyphBits = a.readUI8();
this.AdvanceBits = a.readUI8();
a.GlyphBits = this.GlyphBits;
a.AdvanceBits = this.AdvanceBits;
a.context = fljs.swf.tag.DefineText;
this.TextRecords = a.readTEXTRECORDS();
a.context = null
},
buildMatrix_: function () {
return new flash.geom.Matrix(this.TextMatrix.ScaleX, this.TextMatrix.RotateSkew0, this.TextMatrix.RotateSkew1, this.TextMatrix.ScaleY, this.TextMatrix.TranslateX, this.TextMatrix.TranslateY)
},
evaluate: function (a) {
a.addDefinition(this, this.CharacterId)
},
build: function (a, b) {
return this._buildTextField(a, b)
},
_buildTextField: function (a, b) {
if (!this.TextRecords || !this.TextRecords.length) return null;
this.FontId = this.TextRecords[0].FontId;
this.Bounds = this.TextBounds;
var c = a.fonts2[this.FontId];
a = [];
var d;
fljs.console("definetext");
var e, f, g = 0,
j;
for (var h in this.TextRecords) {
var m = this.TextRecords[h];
d = new flash.text.TextFormat;
if (c) {
d.bold = c.bold;
d.italic = c.italic;
d.font = c.name;
d.fontid = this.FontId
}
if (m.TextColor) {
var k = m.TextColor;
e = 0;
e += k.Red << 16;
e += k.Green << 8;
e += k.Blue;
if (typeof m.TextColor.Alpha != "undefined") d.alpha = m.TextColor.Alpha / 255
}
d.color = e;
if (m.YOffset != null) {
f = m.YOffset;
g = 0
};
d.leading = f;
if (m.XOffset != null) g = m.XOffset;
d.indent = g;
if (m.TextHeight != null) j = m.TextHeight;
d.size = j;
m = m.GlyphEntries;
k = [];
var l = [];
if (m) for (var n in m) {
var p = m[n];
c ? k.push(String.fromCharCode(c.codeTable[p.GlyphIndex])) : k.push(String.fromCharCode(p.GlyphIndex));
l.push(p.GlyphAdvance);
g += p.GlyphAdvance
}
a.push({
text: k.join(""),
advances: l,
format: d
})
}
this.Indent = this.RightMargin = this.LeftMargin = this.Leading = this.Align = 0;
this.FontHeight = this.TextRecords[0].TextHeight;
this.TextColor = this.TextRecords[0].TextColor;
e = new flash.text.TextField;
e.setTextMatrix(this.buildMatrix_());
b && e.getTransform().setColorTransform(b);
e.x = this.Bounds.Xmin;
e.y = this.Bounds.Ymin;
e.setWidth(this.Bounds.Xmax - this.Bounds.Xmin);
e.setHeight(this.Bounds.Ymax - this.Bounds.Ymin);
e.setDefaultTextFormat(d);
e.__setSpans(a);
return e
}
});
fljs.swf.tag.DefineFontInfo2 = function () {};
fljs.addMethods(fljs.swf.tag.DefineFontInfo2, {
read: function (a, b) {
var c = a.stream.byteIndex;
this.FontId = a.readUI16();
this.FontNameLen = a.readUI8();
var d = [];
for (i = 0; i < this.FontNameLen; i++) d.push(String.fromCharCode(a.readUI8()));
this.FontName = d.join("");
a.readUB(2);
this.FontFlagsSmallText = a.readUB(1);
this.FontFlagsShiftJis = a.readUB(1);
this.FontFlagsAnsi = a.readUB(1);
this.FontFlagsItalic = a.readUB(1);
this.FontFlagsBold = a.readUB(1);
this.FontFlagsWideCodes = a.readUB(1);
this.LanguageCode = a.readLangCode();
b =
b.TagLength - (a.stream.byteIndex - c);
this.CodeTable = [];
if (this.FontFlagsWideCodes) {
b = b / 2;
for (i = 0; i < b; i++) this.CodeTable.push(a.readUI16())
} else {
b = b;
for (i = 0; i < b; i++) this.CodeTable.push(a.readUI8())
}
},
evaluate: function (a) {
this.GlyphShapeTable = a.fontsWithoutInfo[this.FontId].GlyphShapeTable;
var b = (new fljs.swf.build.FontBuilder(this, a)).buildDef();
a.defineFont2(this.FontId, this.GlyphShapeTable.length, b, this.FontName, this.FontFlagsBold, this.FontFlagsItalic, this.CodeTable)
}
});
fljs.swf.tag.DefineShape3 = function () {};
fljs.inherits(fljs.swf.tag.DefineShape3, fljs.swf.tag.DefineShape);
fljs.addMethods(fljs.swf.tag.DefineShape3, {
read: function (a) {
a.beginContext(fljs.swf.tag.DefineShape3);
this.ShapeId = a.readUI16();
this.ShapeBounds = a.readRECT();
a.stream.align();
this.Shapes = a.readSHAPEWITHSTYLE();
a.endContext()
}
});
fljs.swf.tag.DoAction = function () {};
fljs.addMethods(fljs.swf.tag.DoAction, {
read: function (a, b) {
this.Actions = a.readActionRecords(b.TagLength)
},
evaluate: function (a, b, c, d) {
a.doActions(d, this.Actions)
}
});
fljs.swf.tag.Protect = function () {};
fljs.addMethods(fljs.swf.tag.Protect, {
read: function (a, b) {
a.skipBytes(b.TagLength)
},
evaluate: function () {}
});
flash.display.FrameLabel = function () {};
fljs.swf.tag.DefineButton2 = function () {};
fljs.addMethods(fljs.swf.tag.DefineButton2, {
read: function (a, b) {
var c = a.stream.byteIndex;
a.context = fljs.swf.tag.DefineButton2;
this.ButtonId = a.readUI16();
a.readUB(7);
this.TrackAsMenu = a.readUB(1);
this.ActionOffset = a.readUI16();
this.Characters = a.readButtonRecords();
this.Actions = this.ActionOffset ? a.readButtonCondActions(b.TagLength - (a.stream.byteIndex - c)) : [];
a.context = null
},
evaluate: function (a) {
a.addDefinition(this, this.ButtonId)
},
build: function (a, b) {
if (b && b.__default) b = null;
var c = new flash.display.MovieClip;
c.def = this;
c.setEnabled(true);
c.trackAsMenu = this.TrackAsMenu;
c.__buttonActions = this.Actions;
var d = [["ButtonStateUp", "up"], ["ButtonStateDown", "down"], ["ButtonStateOver", "over"], ["ButtonStateHitTest", "hitTest"]],
e = new flash.display.Scene;
e.labels = [];
e.name = "Scene 1";
e.numFrames = 3;
c.frameData_ = [];
c.labels_ = {};
var f, g = 0;
for (var j in d) {
var h = d[j][0],
m = d[j][1];
f = null;
for (var k in this.Characters) {
var l = this.Characters[k];
if (l[h]) {
f || (f = new flash.display.Sprite);
var n = this.buildStateDisplayObject(a, l, false);
n && f.addChildAt(n, l.PlaceDepth)
&