SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
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/

Contenu connexe

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 

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