Page 1 of 1

adding a track - look at the code please

Posted: Thu Aug 11, 2011 4:12 pm
by admin12
I am trying to hard code copying and pasting one track from another just to get the procedure down. So far, I can copy it, but not rename it or place it below the current track. There is a label on top of each track that says the name of the track. I will probably change this to an edit box so a person can change the name of the track. I may also want to color code the background of the track so a user can tell each track apart.

Here is the code:

on mousedown
put the loc of group "grpTrack" into CurLocTrack
copy group "grpTrack" to this card
paste
set the name of last group to group "grpTrack2"
set the label of group "grpTrack2" to "Track 2"
--set the loc of the last group to 683,CurLocTrack
move group "grpTrack2" from 683,80 to 683,162 without messages
end mousedown

What is wrong?

Also, how can I turn all of this into an array so that I can keep track of the tracks? Lastly, how can I keep track of WHERE the tracks are (683,82) - the 82 is the important number. All tracks will be starting at 683. All tracks are 80 in height, so adding 82 will give the track enough room. I know to add 82, but creating and updating the array is currently beyond me.

Thanks.

Mike