Direct Icon references are a great thing in Authorware. If you refer to an icon with a direct reference IconID@"My Display Icon", then Authorware will automagically make sure that you have no other icons with that name. It will also track any changes to that Icon's title, so that you don't have to go into any calculations and change IconID@"My Display Icon" to IconID@"Running Horse Graphic". The "Connections" window will show references to your icon, so that you can make sure you're not deleting anything important.
But there are several problems with direct icon references. First, you have to remember the exact title of the icon and type it in correctly. You can't put icons with direct references in a library, and direct references in a Model become @"Deleted Icon" unless the icon you're referring to is also included in the model. In addition, if you delete the icon, you can get @"Deleted Icon" references all through your file.
So, what can you do to get the best of both worlds? I "borrow" an idea that I first heard about from Joe Ganci, which is to place an icon at the beginning of the flow line which stores the IconID's of key icons I'll be using throughout the piece--by referring to them with a direct icon reference. The code might look like this:
Framework := @"Main Framework"
Subroutines := @"My Kool Subroutines"
Sound := @"Variably linked sound icon"
I don't like having a large number of variables that all have the same purpose (storing key IconID's), so I use a property list to store my icon references:
Icons[#Framework] := @"Main Framework"
Icons[#Subroutines] := @"My Kool Subroutines"
Icons[#Sound] := @"Variably linked sound icon"
Joe suggests copying the references and pasting them back into the same calc, then commenting out the second copy. That way, if the reference does get broken, you at least know what the original icon was called. In AW 5.2 or higher, this is easier than ever, because you can just highlight the whole block of code and click the "comment" button.
As an aside, IconID@"My Icon" and @"My Icon" both evaluate to the same thing...the numeric IconID of "My Icon." IconID("My Icon") is similar, and will evaluate to that icon's ID, provided you have no other icons in your piece called "My Icon."