I have found that stencyl can be very buggy if you don't use it exactly as it was intended. Your blocks of code can get corrupted, yet the game often will still compile. As a piece of advice, before you start each session of work, open the stencyl games folder from your desktop etc. and copy the folder containing all of your game to a backup folder and date it. That way you never loose more than a session of work. Always keep your old versions, don't be tempted to delete them until sometime after your project is completed
In particular here are a few things I strongly suggest you never do:
- When stencyl is saving, never try to open new actors etc. or open other things from the dashboard. Stencyl's multitasking allows you to do this, but I have seen things get corrupted, even if you don't edit anything whilst saving (which stencyl also allows you to do!)
- Also when copying blocks between actors or scenes, I find stencyl is very buggy. For me, if I copy code with multiple loops, stencyl usually crashes, and the blocks disappear. Also when you reopen stencyl you often find many copies of parts of the code untidily left at the top of the events screen window, which you never created.
They don't get incorporated into your code, but its generally an untidy mess (these can be deleted safely).
Never copy / drag blocks between scenes, actors containing local attributes. If you do, be aware that even if your new scene, actor etc. has the same attributes the code may compile, but the attributes will not match up. Therefore after dragging and dropping the code delete the old local attributes and put in the new ones (even if they have the same name, and look the same). I guess this is why stencyl does not allow you to export blocks of code! If they use local attributes, they only work in their original context.