SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
Adobe MAX 2009




JSplash   swf to javascript converter

                           Satoshi Ueyama
                                        id:gyuque
JSplashとは?
JSplashとは何か?

SWFムービーをJavascriptとSVGだけで再生するツール




               とりあえずデモ
詳細

SWF


       変換ツール

               SVG生成
JSON

       プレーヤー    タグ実行


               スクリプト変換
タグの例
                                       シェイプ定義
{
 tag:JSplash.tDefineShape,
 id: 1,
                                                       塗色
 bounds:{L:2374,R:8582,T:1744,B:5660},
 fill_styles:[
  {rgb:'000099'},{rgb:'6666cc'},{rgb:'ff6699'}
 ],
 line_styles:[ {w:20,rgb:‘ffffff’},{w:20,rgb:‘000000’},{w:20,rgb:‘000000‘} ],
 shape:[
{t:0,p:[6218,2895],f1:3,ls:2},{t:1,p:[290,-501]},{t:1,p:[2064,1192]},{t:1,p:[-
1192,2064]},{t:1,p:[-1162,-671]},{t:0,f1:1},{t:1,p:[0,609]},{t:1,p:[-
3834,0]},{t:1,p:[0,-
3834]},{t:1,p:[3834,0]},{t:1,p:[0,1141]},{t:0,f0:3,f1:2},{t:1,p:[0,2084]},{t:0,f0:1},{t
:1,p:[-902,-521]},{t:1,p:[902,-1563]},{t:0}
]
}
                                                          シェイプデータ
シェイプの描画例
                                              「左側塗り」なし
                                 始点
{t:0,p:[6218,2895],f1:3,ls:2},
{t:1,p:[290,-501]},
                                   「右側塗り」設定
{t:1,p:[2064,1192]},
{t:1,p:[-1192,2064]},
{t:1,p:[-1162,-671]},
                                 「右側塗り」設定
{t:0, f1:1},
{t:1,p:[0,609]}
・
・
Official Flash Player




JSplash
本日のデモ
http://gyu.que.jp/max/
        small G   small Q
詳細

SWF


       変換ツール

                            SVG生成
JSON

       プレーヤー                タグ実行


                           スクリプト変換


       JSplashは、バーチャルマシンではありません。
       JSplashは、ActionScriptインタプリタではありません。
もう少し詳しく

SWF
                 Flare
        変換ツール

      逆コンパイルされたソース


        プレーヤー

                           スクリプト変換




                     ブラウザのJSエンジン
スクリプト(無理矢理)変換エンジン
function () {                               function () {
  var count;                                  var count = this.__locals__.count;
  if (!count) {                               with (this) {
      count = 0;                                 var count;
  }                                              if (!count) {
  if (count == 2) {                                  count = 0;
      _parent.gotoAndStop(3);                    }
  }                                              if (count == 2) {
  if (++count > 4) {                                 _parent.gotoAndStop(3);
      this.onEnterFrame = function () {if        }
(++count == 8) {_parent.doNext();}};             if (++count > 4) {
      stop();                                        this.onEnterFrame = function () {if
  }                                         (++count == 8) {_parent.doNext();}};
}                                                    stop();
                                                 }
                                              }


Before                                                                  After
                                              this.__locals__.count = count;
                                            }
AS→JS (1)
ローカル変数の「またぎ」


       Frame 1         Frame 2          Frame 3



         var a = 5;     trace(++a);      trace(++a);




                                 6                7
       function() {}    function() {}     function() {}


               保存      復帰        保存     復帰
AS→JS (2)
this / global
                     ムービークリップのふりをする
                     オブジェクトを bind



                          ムービークリップへの参照


                                this._x = 0;
                                v = $version;

                Global   グローバルへの参照

                          function() {}

                              var
こんなんでいいのか?



    意外と何とかなりました。



       デモ 「Elastic Santa」
          by Takayuki Fukatsu
thank you
http://www.libspark.org/svn/ruby/jsplash/trunk/

Weitere ähnliche Inhalte

Andere mochten auch (7)

to touch someone's heart with design
to touch someone's heart with designto touch someone's heart with design
to touch someone's heart with design
 
123 greetings.com app case study
123 greetings.com app case study123 greetings.com app case study
123 greetings.com app case study
 
JUI 2009 O3D Programming
JUI 2009 O3D ProgrammingJUI 2009 O3D Programming
JUI 2009 O3D Programming
 
第11回 HTML5とか勉強会 gyuque
第11回 HTML5とか勉強会 gyuque第11回 HTML5とか勉強会 gyuque
第11回 HTML5とか勉強会 gyuque
 
LL Tiger 2010 (LTの虎 1)
LL Tiger 2010 (LTの虎 1)LL Tiger 2010 (LTの虎 1)
LL Tiger 2010 (LTの虎 1)
 
ASCSS Nite
ASCSS NiteASCSS Nite
ASCSS Nite
 
Kordamiseks NäGemisest & Kuulmisest
Kordamiseks NäGemisest & KuulmisestKordamiseks NäGemisest & Kuulmisest
Kordamiseks NäGemisest & Kuulmisest
 

Ähnlich wie JSplash - Adobe MAX 2009

【12-B-4】 並列処理開発を支援するコンパイラの機能
【12-B-4】 並列処理開発を支援するコンパイラの機能【12-B-4】 並列処理開発を支援するコンパイラの機能
【12-B-4】 並列処理開発を支援するコンパイラの機能
devsumi2009
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHP
Atsuhiro Kubo
 
技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac
terada
 

Ähnlich wie JSplash - Adobe MAX 2009 (20)

Jslunch6
Jslunch6Jslunch6
Jslunch6
 
JSARToolKit / LiveChromaKey / LivePointers - Next gen of AR
JSARToolKit / LiveChromaKey / LivePointers - Next gen of ARJSARToolKit / LiveChromaKey / LivePointers - Next gen of AR
JSARToolKit / LiveChromaKey / LivePointers - Next gen of AR
 
【12-B-4】 並列処理開発を支援するコンパイラの機能
【12-B-4】 並列処理開発を支援するコンパイラの機能【12-B-4】 並列処理開発を支援するコンパイラの機能
【12-B-4】 並列処理開発を支援するコンパイラの機能
 
Ruby Postgres
Ruby PostgresRuby Postgres
Ruby Postgres
 
object-shapes
object-shapesobject-shapes
object-shapes
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHP
 
ブラウザでMap Reduce風味の並列分散処理
ブラウザでMap Reduce風味の並列分散処理ブラウザでMap Reduce風味の並列分散処理
ブラウザでMap Reduce風味の並列分散処理
 
20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編
 
樽家昌也 (日本Rubyの会)
樽家昌也 (日本Rubyの会) 樽家昌也 (日本Rubyの会)
樽家昌也 (日本Rubyの会)
 
Programming JNI
Programming JNIProgramming JNI
Programming JNI
 
S2Flex2
S2Flex2S2Flex2
S2Flex2
 
GAE/J 開発環境でJDO入門
GAE/J 開発環境でJDO入門GAE/J 開発環境でJDO入門
GAE/J 開発環境でJDO入門
 
Grails紹介
Grails紹介Grails紹介
Grails紹介
 
とちぎRuby会議01(原)
とちぎRuby会議01(原)とちぎRuby会議01(原)
とちぎRuby会議01(原)
 
Swap Skills I Phone
Swap Skills I PhoneSwap Skills I Phone
Swap Skills I Phone
 
20090418 イケテルRails勉強会 第2部Air編
20090418 イケテルRails勉強会 第2部Air編20090418 イケテルRails勉強会 第2部Air編
20090418 イケテルRails勉強会 第2部Air編
 
Y Map Mashup Camp
Y Map Mashup CampY Map Mashup Camp
Y Map Mashup Camp
 
Android Animation (in tamil)
Android Animation (in tamil)Android Animation (in tamil)
Android Animation (in tamil)
 
Top 10 php classic traps confoo
Top 10 php classic traps confooTop 10 php classic traps confoo
Top 10 php classic traps confoo
 
技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

JSplash - Adobe MAX 2009

  • 1. Adobe MAX 2009 JSplash swf to javascript converter Satoshi Ueyama id:gyuque
  • 3.
  • 4. 詳細 SWF 変換ツール SVG生成 JSON プレーヤー タグ実行 スクリプト変換
  • 5. タグの例 シェイプ定義 { tag:JSplash.tDefineShape, id: 1, 塗色 bounds:{L:2374,R:8582,T:1744,B:5660}, fill_styles:[ {rgb:'000099'},{rgb:'6666cc'},{rgb:'ff6699'} ], line_styles:[ {w:20,rgb:‘ffffff’},{w:20,rgb:‘000000’},{w:20,rgb:‘000000‘} ], shape:[ {t:0,p:[6218,2895],f1:3,ls:2},{t:1,p:[290,-501]},{t:1,p:[2064,1192]},{t:1,p:[- 1192,2064]},{t:1,p:[-1162,-671]},{t:0,f1:1},{t:1,p:[0,609]},{t:1,p:[- 3834,0]},{t:1,p:[0,- 3834]},{t:1,p:[3834,0]},{t:1,p:[0,1141]},{t:0,f0:3,f1:2},{t:1,p:[0,2084]},{t:0,f0:1},{t :1,p:[-902,-521]},{t:1,p:[902,-1563]},{t:0} ] } シェイプデータ
  • 6. シェイプの描画例 「左側塗り」なし 始点 {t:0,p:[6218,2895],f1:3,ls:2}, {t:1,p:[290,-501]}, 「右側塗り」設定 {t:1,p:[2064,1192]}, {t:1,p:[-1192,2064]}, {t:1,p:[-1162,-671]}, 「右側塗り」設定 {t:0, f1:1}, {t:1,p:[0,609]} ・ ・
  • 7.
  • 10. 詳細 SWF 変換ツール SVG生成 JSON プレーヤー タグ実行 スクリプト変換 JSplashは、バーチャルマシンではありません。 JSplashは、ActionScriptインタプリタではありません。
  • 11. もう少し詳しく SWF Flare 変換ツール 逆コンパイルされたソース プレーヤー スクリプト変換 ブラウザのJSエンジン
  • 12. スクリプト(無理矢理)変換エンジン function () { function () { var count; var count = this.__locals__.count; if (!count) { with (this) { count = 0; var count; } if (!count) { if (count == 2) { count = 0; _parent.gotoAndStop(3); } } if (count == 2) { if (++count > 4) { _parent.gotoAndStop(3); this.onEnterFrame = function () {if } (++count == 8) {_parent.doNext();}}; if (++count > 4) { stop(); this.onEnterFrame = function () {if } (++count == 8) {_parent.doNext();}}; } stop(); } } Before After this.__locals__.count = count; }
  • 13. AS→JS (1) ローカル変数の「またぎ」 Frame 1 Frame 2 Frame 3 var a = 5; trace(++a); trace(++a); 6 7 function() {} function() {} function() {} 保存 復帰 保存 復帰
  • 14. AS→JS (2) this / global ムービークリップのふりをする オブジェクトを bind ムービークリップへの参照 this._x = 0; v = $version; Global グローバルへの参照 function() {} var
  • 15. こんなんでいいのか? 意外と何とかなりました。 デモ 「Elastic Santa」 by Takayuki Fukatsu