Page 3 of 3

Re: Tool Shed

Posted: Fri May 08, 2020 8:47 am
by richmond62
I made a button "NEW" with this script:

Code: Select all

on mouseUp
   if exists(img "ZZ") then
      answer "Do you want to delete your work?" with "Yes" and "No"
      if it is "Yes" then
         delete img "ZZ"
      end if
   end if
   if exists(img "ZZ") then
      --do nix
   else
      create image "ZZ" in card "KARD"
      set the width of img "ZZ" to 500
      set the height of img "zz" to 600
      set the top of img "ZZ" to 0
      set the layer of img "ZZ" to 1
      set the showBorder of img "ZZ" to true
      set the borderWidth of img "ZZ" to 3
      set the threeD of img "ZZ" to false
   end if
end mouseUp
And it did NOT work: nothing happened, and there were no error messages.

Then I remembered I had a 'mouseUp' command in the card . . .

NOW, just to prove what a 'prawn' I am and how that was wrong . . .

I put this into my cardScript:

Code: Select all

on mouseUp
put "Blocked"
end mouseUp
and clicking on my 'NEW' button blocked the cardScript . . . so obviously it is time to go downstairs and make a second cup of coffee. 8)

Re: Tool Shed

Posted: Fri May 08, 2020 8:48 am
by bogs
In fact, on testing out what I said, it *is* impossible.

Code in button script -

Code: Select all

local tmpNum

on mouseUp
   add 1 to tmpNum
   create image ("my Image" & tmpNum)
end mouseUp
Code in card script -

Code: Select all

on mouseUp
   answer "hello"
end mouseUp
You tell me how many times you see hello pop up, here it was none.
I see my image everywhere....
I see my image everywhere....
aPic_cardVsMouse.png (31.73 KiB) Viewed 2423 times

Re: Tool Shed

Posted: Fri May 08, 2020 8:52 am
by richmond62
You got "there" first. :D

Go back to bed before I get scared.

I'm getting out my juju beads to chant my new mantra; "message hierarchy, message order".

Re: Tool Shed

Posted: Fri May 08, 2020 9:04 am
by bogs
Heh, good mantra.