«
 x

Getting started with SuperCard 3

More about object names

Here's a little more about identifying objects. In the previous page we made a card button, which showed in the Property Inspector that is was unnamed, button number 1, and ID 100:

Name: [empty]    No: 1    ID: 100    Style: [RoundRect]

We then named the card button, and followed this up with a script which changed the button's name whenever it was clicked. So it should be clear that object names can be changed pretty easily. Object numbers can also be changed, but not directly. The number of an object is determined by what position it is in, in the stacking order. The first button is automatically number 1, the second (which sits on top of number one in the stacking order) is number 2, and so on. It however the second button is selected and 'sent to the back' of the stacking order (just like in any drawing or DTP application) it becomes button number 1.

Object ID numbers are different. There is no way to change the ID number of an object. This is therefore a foolproof way of specifying a specific object in cases where both the name and the stacking order position could be changed. The ID number starts at 100 and goes up in ones. If an item is copied and pasted the newly created item is assigned a new ID, gets the next number in the stacking order, but keeps the name of the object it was copied from.

The number and ID of an object is determined according to the other objects of the same type already in the same place. Having half a dozen card buttons on a card doesn't mean that the first card field you make will be number 7 or ID 106.