facebook twitter hatena line email

「Flash/代替/swf2js」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(Admin がページ「Flash/swf2js」を「Flash/代替/swf2js」に、リダイレクトを残さずに移動しました)
(指定したエレメントにロード)
 
(同じ利用者による、間の4版が非表示)
行2: 行2:
 
swfファイルをhtml5で動作させるjsライブラリ
 
swfファイルをhtml5で動作させるjsライブラリ
  
参考:
+
参考:https://twitter.com/TANAKA_U/status/1645457315401994242
https://twitter.com/TANAKA_U/status/1645457315401994242
+
 
 +
参考:https://fedor-hidor.blog.jp/archives/21214199.html
 +
==ダウンロード==
 +
https://github.com/swf2js/swf2js
 +
 
 +
==インストール==
 +
swf2js.jsだけを公開dirへupload
 +
 
 +
<pre>
 +
<html>
 +
<body>
 +
<head>
 +
    <script type="text/javascript" src="/js/swf2js.js"></script>
 +
</head>
 +
<body>
 +
    <script type="text/javascript">
 +
        swf2js.load("/swf/helloworld.swf");
 +
    </script>
 +
</body>
 +
</html>
 +
</pre>
 +
 
 +
==指定したエレメントにロード==
 +
<pre>
 +
<center>
 +
<div id="altContent">
 +
<h1>example</h1>
 +
</div>
 +
</center>
 +
<script type="text/javascript">
 +
swf2js.load("/swf/helloworld.swf",  { tagId:"altContent", width: "750", height: "600"} );
 +
</script>
 +
</pre>
 +
 
 +
==FlashVarsを追加する場合==
 +
<pre>
 +
swf2js.load("/swf/helloworld.swf", {FlashVars: {
 +
    username: "taro",
 +
    age: 2,
 +
}});
 +
</pre>

2024年3月3日 (日) 11:33時点における最新版

swf2jsとは

swfファイルをhtml5で動作させるjsライブラリ

参考:https://twitter.com/TANAKA_U/status/1645457315401994242

参考:https://fedor-hidor.blog.jp/archives/21214199.html

ダウンロード

https://github.com/swf2js/swf2js

インストール

swf2js.jsだけを公開dirへupload

<html>
<body>
<head>
    <script type="text/javascript" src="/js/swf2js.js"></script>
</head>
<body>
    <script type="text/javascript">
        swf2js.load("/swf/helloworld.swf");
    </script>
</body>
</html>

指定したエレメントにロード

<center>
<div id="altContent">
<h1>example</h1>
</div>
</center>
<script type="text/javascript">
swf2js.load("/swf/helloworld.swf",  { tagId:"altContent", width: "750", height: "600"} );
</script>

FlashVarsを追加する場合

swf2js.load("/swf/helloworld.swf", {FlashVars: {
    username: "taro",
    age: 2,
}});