diff --git a/index.html b/index.html index c4ec627..128f586 100644 --- a/index.html +++ b/index.html @@ -41,7 +41,7 @@

What is a .sbx file?

- +
@@ -52,7 +52,7 @@

What is a ScratchX URL?

-
+
diff --git a/js/scratchx.js b/js/scratchx.js index d850abe..17db185 100644 --- a/js/scratchx.js +++ b/js/scratchx.js @@ -104,6 +104,27 @@ swfobject.switchOffAutoHideShow(); swfobject.embedSWF('Scratch.swf', 'editor', '100%', '100%', '11.7.0', 'libs/expressInstall.swf', flashVars, params, null, handleEmbedStatus); + +/* File uploads */ + +function sendFileToFlash() { + var file = this.files[0]; + console.log("Got file for Flash", file); +} + +$("[data-action='load-file']").click(function(e) { + $('').on('change', sendFileToFlash).click(); +}); + +function sendURLtoFlash(url) { + console.log("Got URL for Flash", url) +} + +$("[data-action='load-url'] button").click(function(e) { + sendURLtoFlash($(e.target).siblings('input[type="text"]').val()); +}); + + /* Page switching */ $("[data-staticlink]").click(function(e) {