Tool Shed

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Tool Shed

Post by richmond62 » Fri May 08, 2020 8:47 am

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)
Last edited by richmond62 on Fri May 08, 2020 8:53 am, edited 2 times in total.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Tool Shed

Post by bogs » Fri May 08, 2020 8:48 am

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.
aPic_cardVsMouse.png
I see my image everywhere....
aPic_cardVsMouse.png (31.73 KiB) Viewed 1979 times
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Tool Shed

Post by richmond62 » Fri May 08, 2020 8:52 am

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".

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Tool Shed

Post by bogs » Fri May 08, 2020 9:04 am

Heh, good mantra.
Image

Post Reply