Page 1 of 1

Help with a handler

Posted: Mon Apr 23, 2018 4:39 pm
by amelia16
I'm doing an application where the user can paint a house and I have a list of the colors on a field and I want the user to click on a color and click on a section of the house, like the chimney or the door (each section has a graphic outlining it) and I want the background color to change to the color they chose but I have not the slightest clue how to do that! Please help!

This is my handler so far:

on mouseUp
repeat for each line
set the color of me to the backgroundColor of the target
end repeat
end mouseUp

Re: Help with a handler

Posted: Mon Apr 23, 2018 4:50 pm
by dunbarx
Hi.

Experiment. Make a locked field named "colorList" with some color names on each line and a couple of buttons on a new card. Do not name the buttons quite yet. Put this in the card script:

Code: Select all

on mouseUp
   if "colorList" is in the name of the target then
      set the currentColor of this cd to the clickText
   end if

   if "button" is in the name of the   target then
      set the backColor of the target to the currentColor of this cd
   end if
end mouseUp
Click on any line in the field. Click on any button.

Craig Newman