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

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
sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

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

Post by sms5138 » Tue Dec 15, 2015 3:48 pm

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
Last edited by sms5138 on Tue Dec 15, 2015 5:44 pm, edited 1 time in total.

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

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

Post by Klaus » Tue Dec 15, 2015 5:02 pm

Hi Sean,

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


Best

Klaus

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

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

Post by sms5138 » Tue Dec 15, 2015 5:40 pm

Thanks!

That did wonders!

:D

-Sean

Post Reply