Good points. But the selectedObjects will contain a list of objects in the order they were selected (very dammed handy), not in the order they appear on the screen, nor the order they were in before calling the command. So by selecting objects in the order you want them to be, calling this command will order them properly, and at the topmost layer, preventing me from burying them behind other objects.
Also I discovered a bit of a flaw in my code. If I click on a field that is a part of a group then I will likely throw an error, because you cannot set a fields layer to something higher than the layer of the highest layered object in the group. In other words, you have to change the layer of the entire group, not just the field itself. Hence the following update: on clickOrder put the selectedobjects into theObjectList repeat for each line theObject in theObjectList if "of group" is in theObject then put wordoffset("group", theObject) into firstWord put word firstWord to -1 of theObject into theNewObject set the layer of theNewObject to top else set the layer of theObject to top end if end repeat end clickOrder On Dec 6, 2011, at 12:09 PM, Mark Wieder wrote: > Bob Sneidar <bobs@...> writes: > >> >> Belay my last. Pretty simple: >> >> on clickOrder >> put the selectedobjects into theObjectList >> repeat for each line theObject in theObjectList >> set the layer of theObject to top >> end repeat >> end clickOrder > > Depending on the number of theObjects you have, you may want to lock the > screen > first - changing the layer of an object affects the visible layering. > > Also, there may well be times when the tab order you desire doesn't > necessarily > match the visible ordering of objects on the screen - you may want to have > other > non-tabbable objects interspersed with them, or you might want to have other > objects on top of them layerwise (ok - that's not a word, but you get the > idea). > I do think a tab-order property is a useful thing to add in addition to the > layer hierarchy. > > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode