Export all sprites' costumes and sounds in zip

last time i asked how to download zip including costumes and sounds of sprite in it, and i got solution by @dardoro making this
costumes script pic (5)

it works fine, but now i thought on exporting zip with all sprites files, like

zip
| - sprites
| | - sprite1
| | | - costumes
| | | | - example.png
| | | - sounds
| | | | - example.ogg
| | - sprite2
| | | - costumes
| | | | - example.png
| | | - sounds
| | | | - example.ogg

i know its a bit complicated, i would do that, but it dont know how to get an array of all sprites in js

You should look into the snap source code then.

i did dig it, couldnt find info on that

can someone help me with that?

I did a quick search in the console, and found that the list of sprites is here

ide = this.parentThatIsA(IDE_Morph)
sprites = ide.sprites.asArray()

You can then loop over this, and get the costumes and sounds as in the script that you have before, only this must be replaced by the current sprite in the sprites list. The name of the sprite is just sprite.name.

Just as a side note, if you want to access snap from the console for searching for something quickly, just do

ide = world.children[0]

Then you can access anything in the snap environment just through the ide variable, and the console also gives you all the attributes and functions that the ide has, just by typing in ide.

thanks, i ll try it

hey, i know it sounds weird, but I can't choose your post as solution, why?

no solution button in this category...

damn... at least thanks for helping @ego-lay_atman-bay

you can change the category to "help with snap", press the solution button, and change the category again...

I haven't tested it, but I think it will work...

it did work, thanks

i confirm it work...

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.