Hi William,

You were almost there. The statement that sets the 'tName' variable value AND the condition-check that uses it must BOTH be inside the repeat loop, like this:

on mouseUp
   repeat with x = 1 to 5
      put "A"&x into tName
      if the backgroundcolor of grc tName of grp "A" \
          = the backgroundcolor of grc tName of grp "B"
      then answer "AnswerA"
      else answer "AnswerB"
   end repeat
end mouseUp

HTH -
Phil Davis


On 3/4/10 10:01 PM, William de Smet wrote:
Hi there,


I am having trouble with 'shortening' some script but don't know why.

The first script works but the second one doesn't. What am I doing wrong?

Thanks!


Greetings,


William

*
*

*
*

*on mouseUp*

*if* the backgroundcolor of grc "A1" of grp "A" = the backgroundcolor of grc
  "A1" of grp "B" and \

*if the backgroundcolor of grc "A2" of grp "A" = the backgroundcolor of grc
  "A2" of grp "B" and \*

*if the backgroundcolor of grc "A3" of grp "A" = the backgroundcolor of grc
  "A3" of grp "B" and \*

*if* the backgroundcolor of grc "A4" of grp "A" = the backgroundcolor of grc
  "A4" of grp "B" and \

*if* the backgroundcolor of grc "A5" of grp "A" = the backgroundcolor of grc
  "A5" of grp "B"

  *then* *answer* "AnswerA"

*else* *answer* "AnswerB"

*end* mouseUp




*on* mouseUp

    *repeat* with x = 1 to 5

       *put* "A"&x into tName

       *end* *repeat*

  *if* the backgroundcolor of grc tName of grp "A" = the backgroundcolor of
grc tName of grp "B"

*then* *answer* "AnswerA"

*else* *answer* "AnswerB"

*end* mouseUp

--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to