Page 1 of 1

Deleting messages from clone images

Posted: Fri Jan 07, 2011 1:19 pm
by smartboardmusic
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

Re: Deleting messages from clone images

Posted: Fri Jan 07, 2011 1:44 pm
by Klaus
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

Re: Deleting messages from clone images

Posted: Wed Jan 12, 2011 12:43 pm
by smartboardmusic
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???

Re: Deleting messages from clone images

Posted: Wed Jan 12, 2011 1:08 pm
by Klaus
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