Page 1 of 1

error when creating random moving object [solved]

Posted: Thu Jul 16, 2015 4:04 pm
by sms5138
Hi everyone!

I'm trying to create a box that will move randomly about the screen, and can't seem to get it to work. when i open the card it will place the object in a random location, but will not move after that. Here's what i've found to work to at least get it to move upon opening, but it does not seem to move after that...

Code: Select all

on openCard
   moveImage
end openCard


on moveImage
   put random(100) into x
   put random(200) into y
   set the loc of image id 1015 to x,y
   
   send “moveImage” to me in 2 seconds
end moveImage
I'm hoping someone may have some insight as to what i'm missing.

thanks in advance!

Sean

Re: error when creating random moving object

Posted: Thu Jul 16, 2015 4:10 pm
by LCNeil
Hi Sean,

You have curly quotes around the image name. These need to be straight or the script will silently break.

Code: Select all

send "moveImage" to me in 2 seconds
Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
-

Re: error when creating random moving object

Posted: Thu Jul 16, 2015 7:17 pm
by sms5138
Thanks Neil!

That did the trick!

regards,

Sean