file import
Demonstration for the file import library that I have made. This library supports raster image files, SVG files, and audio files. It also supports text and binary files but every file is technically a binary file so support for binary is kind of implied. If you want to get the library, see inside this project and click on File > Export Blocks. The blocks also include help notes. MINOR UPDATE 2/19/2021: - I changed the code of the read file block a bit. Reading a file in JavaScript is an asynchronous operation so to make it synchronous for Snap!, I made it use Snap! variables with JavaScript, and pausing the process. I redid it so it still pauses the process, but now the JavaScript function returns a JavaScript function returning the new value which the Snap! code will read once the process is once again resumed. That was lengthy.
Created August 22, 2020
Last updated February 19, 2021
Published August 22, 2020