If I just plunk down in the scripting area:
where "box" is a sprite name, nothing happens, the parent isn't changed, there is no error.
However, if I try this in a script (using 'tell ...'), I get a TypeError: can't read property cloneOriginName of null.
I have a workaround for this, but am wondering about the lack of error in the first case, and also if the set by name seems like a reasonable thing to be able to do. The lack of error in the first instance initially led me to believe it was working and took me down a path that required the workaround.
If you just type the name, it doesn't work, but if you put the object reporter in the input like this
then it will work (you can see the parent of the sprite by using this block )
Yes, I wrote a simple reporter to walk the list of sprites and return the one with the name I wanted: the workaround. other questions are still on the table.
Maybe the context will help: I'm creating clones and giving them names and parents, so I wanted to refer to the parents by name.
I cannot think of a simple solution to the problem without it because the set ____ to ____ block only lets you set values for vars.
the empty object return at the end, on failure, doesn't really work, but if there is a sprite with the desire name, it does
here's a much much simpler way to do it
if the sprite does not exist, it doesn't report (and it doesn't throw an error) you can also ask for the sprite that you're in, so if you're in the sprite "sprite" and you type in sprite, then it will report itself. It'll also report itself if you type in myself.
excellent! and really amplifies my initial question about the 'set parent' not working with names.
I guess this is mostly a question about error reporting, but I think the ask and tell blocks introduce some confusion between a sprite and its name - I'm not suggesting to change that.
One step further: just don't make the
sprite with name reporter