This commit is contained in:
2018-01-05 18:22:22 +03:00
parent d013fb4988
commit 58ed988f75
4 changed files with 1 additions and 225 deletions

View File

@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="swf.js"></script>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="swf" style="width: 100%; height: 100%;"></div>
<script type="text/javascript">
var swf = new Swf("swf", "flash/bin/armageddon.swf");
</script>
</body>
</html>

View File

@@ -1,51 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>::APP_TITLE::</title>
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
::if linkedLibraries::::foreach (linkedLibraries)::
<script type="text/javascript" src="::__current__::"></script>::end::::end::
<script type="text/javascript" src="./::APP_FILE::.js"></script>
<script>
window.addEventListener ("touchmove", function (event) { event.preventDefault (); }, false);
if (typeof window.devicePixelRatio != 'undefined' && window.devicePixelRatio > 2) {
var meta = document.getElementById ("viewport");
meta.setAttribute ('content', 'width=device-width, initial-scale=' + (2 / window.devicePixelRatio) + ', user-scalable=no');
}
</script>
<style>
html,body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
#openfl-content { background: #000000; width: ::WIN_WIDTH::px; height: ::WIN_HEIGHT::px; margin: 0 auto; }
::foreach assets::::if (type == "font")::
@font-face {
font-family: '::fontName::';
src: url('::targetPath::.eot');
src: url('::targetPath::.eot?#iefix') format('embedded-opentype'),
url('::targetPath::.svg#my-font-family') format('svg'),
url('::targetPath::.woff') format('woff'),
url('::targetPath::.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}::end::::end::
</style>
</head>
<body>
<div id="openfl-content"></div>
<script type="text/javascript">
lime.embed ("openfl-content", ::WIN_WIDTH::, ::WIN_HEIGHT::, "::WIN_FLASHBACKGROUND::");
</script>
</body>
</html>

View File

@@ -1,148 +0,0 @@
(function(window) {
if (!window.Swf) {
window.Swf = function(eid, src, listener, params) {
this.id = "adman" + window.Swf.i++;
this.listener = listener;
this.embed(eid, src, params);
window.SWF_CALLBACKS = window.SWF_CALLBACKS || {};
window.SWF_CALLBACKS[this.id] = this.onSwfEvent();
};
window.Swf.i = 0;
window.Swf.prototype = {
dispatch: function(type) {
if (this.listener && this.listener["on_" + type]) {
var args = [].slice.call(arguments, 1);
this.listener["on_" + type].apply(this.listener, args);
}
},
onSwfEvent: function() {
var self = this;
return function(type, arg1, arg2) {
self.dispatch(type, arg1, arg2);
};
},
insertAfter :function(elem, refElem) {
var parent = refElem.parentNode;
var next = refElem.nextSibling;
if (next) {
return parent.insertBefore(elem, next);
} else {
return parent.appendChild(elem);
}
},
embed:function(target, src, params) {
params = params || {};
params["callback"] = "SWF_CALLBACKS." + this.id;
var flashData = {
params: {
id: this.id,
quality: "high",
allowScriptAccess: "always",
allowFullScreen: true,
wMode: "opaque",
base: null,
swLiveConnect: true
},
properties: {
name: this.id,
width: "100%",
height: "100%"
},
vars: params
};
this.swf = this.buildFlashElement(src, flashData);
this.swf.style["position"] = "absolute";
this.swf.style["left"] = 0;
this.swf.style["top"] = 0;
//this.swf.style["visibility"] = "hidden";
if (target) {
target = document.getElementById(target);
this.insertAfter(this.swf, target);
} else {
document.body.appendChild(this.swf);
}
},
typeOf: function (item) {
if (item == null) return "null";
if (item.nodeName) {
if (item.nodeType == 1) return "element";
if (item.nodeType == 3) return (/\S/).test(item.nodeValue) ? "textnode" : "whitespace";
} else if (typeof item.length == "number") {
if (item.callee) return "arguments";
}
return typeof item;
},
toFlashVars: function (object, base) {
var queryString = [];
for (var key in object) {
var value = object[key];
if (base) key = base + ":" + key;
var result;
switch (this.typeOf(value)) {
case "object":
result = this.toFlashVars(value, key);
break;
case "array":
var qs = {};
value.each(function (val, i) {
qs[i] = val;
});
result = this.toFlashVars(qs, key);
break;
default:
result = key + "=" + encodeURIComponent(value);
}
if (value != null) queryString.push(result);
}
return queryString.join("&");
},
buildFlashElement: function (path, options) {
var params = options.params;
var vars = options.vars;
var properties = options.properties;
params.flashVars = this.toFlashVars(vars);
var isIE = /*@cc_on!@*/false;
if (isIE) {
properties.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
params.movie = path;
} else {
properties.type = "application/x-shockwave-flash";
}
properties.data = path;
var build = "<object id=\"" + params.id + "\"";
for (var property in properties) build += " " + property + "=\"" + properties[property] + "\"";
build += ">";
for (var param in params) {
if (params[param]) build += "<param name=\"" + param + "\" value=\"" + params[param] + "\" />";
}
build += "</object>";
var div = document.createElement("div");
div.innerHTML = build;
return div.firstChild;
},
dispose: function() {
if (this.swf) {
this.swf.dispose();
this.swf.parentNode.removeChild(this.swf);
}
}
};
}
})(window);