image.setBody( body ) not working

Report problems here (or use the built-in feedback dialog in the editor)
Post Reply
joolean
Posts: 19
Joined: Mon Jun 24, 2013 7:46 am

image.setBody( body ) not working

Post by joolean »

With the following script:

image img = getImage("testImage");
body b = getBody("testBody");
img.setBody( b );

I get the following error
"Invalid body passed to setBody (image id 1)"

Doesn't matter whether I use string names or ids and I've tried various image, body and script scenarios but nothing seems to work.

Bah I just resolved it by going
img.setBody( b.id );
instead. Still, what is the reason the first version doesn't work?
Thanks,
Jules.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: image.setBody( body ) not working

Post by iforce2d »

Hi Jules
Thanks for reporting this, it was a bug. Since it was an extremely simple fix (just one character :)) I have "retro-fixed" it in the current 1.5.4 that is already up on the server. You can make another build of 1.5.4 if you like.
joolean
Posts: 19
Joined: Mon Jun 24, 2013 7:46 am

Re: image.setBody( body ) not working

Post by joolean »

Great!
Thank you.
Post Reply