Page 1 of 1

how to move a cloned object to a specific group. *solved*

Posted: Tue Dec 15, 2015 3:48 pm
by sms5138
Hi everyone,

i'm sure i'm missing something simple, but can't figure out wha that is... I'm trying to clone a button, and move it to a specific group.

I know how to create a button in a group, and clone an object using the following code:

clone pre-existing object:

Code: Select all

 on mouseUp      
     clone the button "ButtonTemplate"
     set the name of the last button to "button1"
     set the loc of button "button1" to 212,162
end mouseUp
create in group:

Code: Select all

on mouseUp
     create button "button1" in grp "test"
end mouseUp
i'm not sure how to put these to actions together... what i'd like to do is clone a pre-existing button, rename it, move it to a specific location, and then add it to a specific group.

i feel like i'm on the right track, but that confidence could be completely unfounded...

anyways if anyone has any insight into how i might be able to accomplish this i'd greatly appreciate it!

thanks in advance!

-Sean

Re: how to move a cloned object to a specific group.

Posted: Tue Dec 15, 2015 5:02 pm
by Klaus
Hi Sean,

what about:
...
copy btn "Button template" to grp "test"
## do more stuff with the last button of grp "test"
...
:D


Best

Klaus

Re: how to move a cloned object to a specific group.

Posted: Tue Dec 15, 2015 5:40 pm
by sms5138
Thanks!

That did wonders!

:D

-Sean