error when creating random moving object [solved]

Creating Games? Developing something for fun?

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

error when creating random moving object [solved]

Post by sms5138 » Thu Jul 16, 2015 4:04 pm

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
Last edited by sms5138 on Tue Jul 21, 2015 2:52 pm, edited 1 time in total.

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: error when creating random moving object

Post by LCNeil » Thu Jul 16, 2015 4:10 pm

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
-

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: error when creating random moving object

Post by sms5138 » Thu Jul 16, 2015 7:17 pm

Thanks Neil!

That did the trick!

regards,

Sean

Post Reply

Return to “Creating Games”