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 » Sun Apr 13, 2014 8:12 am

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: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: image.setBody( body ) not working

Post by iforce2d » Sun Apr 13, 2014 11:22 am

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 » Wed Apr 16, 2014 11:20 am

Great!
Thank you.

Post Reply