Helpful Tips

Every object has a name. The name is what identifies the object on the page. Every object on a page must have a unique name—in fact, AutoPlay Media Studio won't let you give two objects on a page the same name.

When you add a new object, it is automatically given a default name like "Label1" or "Image8." Each time you add another image of the same type, AutoPlay adjusts the number to make sure the new object's name is unique. For example, when you add two button objects in a row to a blank page, the first object would be named Button1, and the second object would be named Button2.

Now, suppose you added 12 more button objects to the page. You would have 14 objects with names from Button1 all the way to Button14. Which is okay, if you don't need to refer to those objects at all...and some objects are like that, just sitting on the page, never needing to be the target of an action like Button.SetVisible or Button.SetText. But as soon as you want to perform an action on an object, things can get tricky if they all have relatively meaningless names.

The problem with the default names is that they don't give you any indication of what the object is used for. Sure, you could remember that "Button9" is the one with "Install Files" in it, and "Label4" is the one that you display the user's name in. But chances are, you'll forget which object is which, or you'll come back to your project after an especially long weekend and find yourself wishing you gave the objects better names.

Which is exactly what you should do whenever you add an object: give it a meaningful name.

Giving objects names that you can easily recognize helps you make sure that the object you're working on is the object you wanted to be working on. So, give each object a name that you can remember...and make sure it's an object name that will still make sense to you three months from now when you come back to make changes to the project.

(The only exception is if you know for sure that the object will never need to be the target of an action, or if you're working on a simple project that only has three objects in it.)

So What Makes a Good Object Name?

There are no hard and fast rules for naming objects—other than the fact that you can't have two objects on a page with the same name, the sky's the limit on what you call the little critters. Before you start naming everything after your late great uncle's exotic collection of sea shells, though, it pays to consider the following bits of advice.

Сайт управляется системой uCoz