Path from group to card
Posted: Wed Aug 22, 2012 3:33 pm
Ok guys, I'm making my own control, effectively a data tree (yes I know there are ones out there that I could use, but I want to make my own)
the situation is, I want to keep the code as separate from the control as possible, so I'm designing the elements on a stack that will effectively be used as a library (henceforth referred to as the library stack)
The code for the control will sit on the library stack and the actual grouped objects will call the commands and functions that they need, basically trying to make it into a class as much as livecode can do.
The problem is that when I copy the tree to a new card/stack, I need to know the exact number of groups it is embedded in, as it could vary, this mainly affects things like changing images
but so far I've found that to do something like that you need to specify each and every group all the way up to the card, such:
is there any simple way of doing this? Or am I going to have to restrict it in some way?
Cheers
David
the situation is, I want to keep the code as separate from the control as possible, so I'm designing the elements on a stack that will effectively be used as a library (henceforth referred to as the library stack)
The code for the control will sit on the library stack and the actual grouped objects will call the commands and functions that they need, basically trying to make it into a class as much as livecode can do.
The problem is that when I copy the tree to a new card/stack, I need to know the exact number of groups it is embedded in, as it could vary, this mainly affects things like changing images
Code: Select all
set the filename of img "img" of group "...." and so on on card "card ..." on stack "stack ..."
Code: Select all
set the filename of img "img" of group "a" of group "b" of group "c" ... of group "n" on card...
Cheers
David