Hi all!
I tried to export a sprite with all its blocks and variables in another project.
Blocks are ok, but variables aren't been imported and I receive the error
"a variable of name xxx does not exist in this context"
How can I export all the item of a sprite and import into another project?
Variables that are not sprite-only depend on the project, not on the sprite.
You can prevent this by adding some kind of detection to the sprite that will check if the variable exists or not, if it doesn't, creates the variable.
if <not <does var [variable v] exist?::variables> > {
create [global V] var [variable] @delInput @verticalEllipsis @addInput::variables
set var [variable v] to [value]::variables
}
The variable blocks above, different from the default, can be found by clicking the file menu, going to the Libraries and importing "Create variables".