Deleting messages from clone images

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

Post Reply
smartboardmusic
Posts: 2
Joined: Fri Jan 07, 2011 1:16 pm

Deleting messages from clone images

Post by smartboardmusic » Fri Jan 07, 2011 1:19 pm

is there a way to clone an image without keeping the original message of the original ones?. I need to change the mouseup and mousedown of the cloned images.
Thanks

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Deleting messages from clone images

Post by Klaus » Fri Jan 07, 2011 1:44 pm

Hi,

you can of course:
...
clone img "name of image"
set the script of last img to empty
...
Is that what you mean?

Remember that setting a script in a standalone has limits!
I would "outsource" the handlers to the card or stack script or use behaviors, which do not have these limits!


Best

Klaus

smartboardmusic
Posts: 2
Joined: Fri Jan 07, 2011 1:16 pm

Re: Deleting messages from clone images

Post by smartboardmusic » Wed Jan 12, 2011 12:43 pm

Hi Klaus and thanks so much for the answer. Now a second difficulty. aroused. I need to grab the cloned image but my code does not work

One possibility was this one:

clone me
set the script of last img to empty
grab last img

but it doesnt grab the cloned image. The second choice was this one:

clone me
set the script of me to empty
grab me

but I gave me an error telling that I cant remove the script of myself.

Do you know if I can there is a way to grab the cloned image???

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Deleting messages from clone images

Post by Klaus » Wed Jan 12, 2011 1:08 pm

Hi smartboardmusic (are a musician?),

there is no problem to set SHORT scripts in a standalone!
So you could do:
...
clone me
set the script of last img to "on mousedown" & CR & "grab me" & CR & "end mousedown"
...

But I would use the new behaviors, which lets you assign even very long scripts
to objects in a standalone without problems!

Do like this:
1. Create a button (yes a button) with a script like this (I name the button "grabme" in my example"):

Code: Select all

on mousedown
   grab me
end mousedown
or whatever you want to do with a new image
2. Hide the button, if necessary
3. Then you could do this:
...
clone me
set the behavior of last image to the long ID of btn "grabme"
...
4. Done :-)


Best

Klaus

Post Reply