Repeat loop test

BNig niggemann at uni-wh.de
Sun May 17 14:47:31 EDT 2009


Barry,

what Colin is saying is that you refer to the images by their number. As
soon as you change the layer of an image its number will be different. So
that is why the blue ball, which has no harbour gets called, even though you
tried to avoid it, because all of a sudden blue ball will be image x. 
I changed your script to use the names of the balls:

----------------
 on mouseUp
    repeat with x = 1 to the number of images of this card
    put the short name of image x into tShortName
      if "ball" is not in the name of image x then
       next repeat
        else 
    set the layer of image tShortName to bottom
    wait for 3 ticks
    set the loc of image tShortName to the harbour of image tShortName
    set the layer of image tShortName to top
    wait for 3 ticks
   move image x to the berth of image tShortName
   end if
    end repeat
 end mouseUp
---------------------

This works for you test stack on revOnline version up to 3.0 

try to reference the balls by their name as I did in the script and you are
set to go.
regards
Bernd




barryb at libero.it wrote:
> 
> 
> OK, here is the question. 
> What should I do to attain the required 
> results as described?
> 
> The answer you gave me is undoubtably valid but it just 
> means that, once again, what I want to do is impossible (for me) in
> Revolution 
> and so reduces to 'Trash the project'.
> 
> Thanks for such a quick reply.
> Barry 
> Barber
> 
> 

-- 
View this message in context: http://www.nabble.com/re%3A-Repeat-loop-test-tp23585964p23586378.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list