Please help to fix this!

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ahmedinvent24BUSGdU9
Posts: 43
Joined: Mon Oct 15, 2012 6:44 pm

Please help to fix this!

Post by ahmedinvent24BUSGdU9 » Sun Jan 20, 2013 11:41 am

Hi all, Now i have 2 images, graphic line, and a button.

now i wrote in the code of the button

Code: Select all

move img "name" to the points of graphic line in 1 sec  

if intersect(img "name", image "name1", "opaque pixels") then
hide img "name1"        
   end if
now when image "name" moves and then intersect with image "name1" image "name 1" still visible

PLease how to fix this :) :)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Please help to fix this!

Post by jmburnod » Sun Jan 20, 2013 12:40 pm

Hi ahmedinvent24BUSGdU9,

Try this. It is not perfect but does the job for two images.

Code: Select all

on mouseUp
   put the points of grc "line" into tListPoints -- 
   put the num of items of tListPoints into nbMax
   put round(1000/nbMax) into tStepTime
   repeat for each line tPoint in tListPoints
      move img "name" to tPoint in  tStepTime milliseconds  
         if intersect(img "name", image "name1") then
      hide img "name1"     
   else
      show     img "name1"
      end if 
   end repeat
end mouseUp
Best regards
Jean-Marc
https://alternatic.ch

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: Please help to fix this!

Post by dave_probertGA6e24 » Sun Jan 20, 2013 12:50 pm

Hi Ahmed,

The cause of it not working is that the movement happens before the check for intersection, not during it. JM's code will correct that.

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

ahmedinvent24BUSGdU9
Posts: 43
Joined: Mon Oct 15, 2012 6:44 pm

Re: Please help to fix this!

Post by ahmedinvent24BUSGdU9 » Sun Jan 20, 2013 2:47 pm

Thank you Jean-Marc and Dave

:D :)

Post Reply