November 2, 2002   Tip of the Week Mailing List
The Tip

Did you ever want to find out where an icon was originally placed in the window? For instance, maybe your client thinks the default "put" back" behavior on a Drag and Drop interaction is too slow, and you want to code your own.

The GetPostPoint() and GetPostsize() functions are among those Target functions that work at runtime. GetPostPoint() returns a point with the top left corner of the icon in it, and GetPostSize() returns the size of the icon, also as a point.

A point is kind of like a mini-list, with the first item in the list being the x coordinate and the second part being the y coordinate. You can address the two elements of the point just like items in other lists, and you can do math on the entire point at one time. Since Displays, movies, sprites, etc., are positioned from the center, unlike responses, this can be very useful. Hot Spots, buttons, and the like are positioned from the top left corner, in case you were wondering.

The code for determining where the center of an object was originally displayed might go something like this:
TopLeft := GetPostPoint(@"my Display", #display)
Size := GetPostSize(@"my Display", #display)
Center := TopLeft + Size/2

Then, you'd use Center[1] for the X coordinate and Center[2] for the y coordinate.

Note that the GetPostPoint() function returns the physical location where the Display was posted to the window. So, if your Display has been positioned with variables, GetPostPoint() will reflect where that icon would be if you had not positioned it with variables. Similarly, if you move an icon after it is displayed, this will not change its post point.



 
What is a Target Function?

To me, the name "Target functions" is a bit misleading. The name comes from the fact that when you create a KO , you are writing one Authorware file that changes the code in another Authorware file. The file that is being changed is referred to as the target file.

The Target functions were designed so that you can create Authorware code that modifies other Authorware code. This is so that you can automate as many tasks as possible, leaving you free to concentrate on the fun stuff. Since they were created as authoring tools, target functions usually will not change anything about a file once it is packaged. Also, functions that read icon or file properties, such as GetIconContents(), will sometimes return different information after the file is packaged than before.

Before you depend on any function that is listed in the Target category, be sure to package a small test piece to check to see that it does the same thing after it is packaged as before. Note that SetIconProperty() does not appear in the Target functions, but most of the time it won't work at runtime either. 

Repeat of LMS Chat Wednesday, November 6

Last time, we just barely scratched the surface of the subject of integrating with an LMS, so I am holding a repeat of the Web Delivery chat.

The Date will be Wednesday, November 6

Guests TBD.

Time: 6:30 pm Central Daylight time (7:30 Eastern, 5:30 Mountain, 4:30 Pacific). This is 12:30 am GMT.

To get to the chat, go to http://www.authorware-amy.com and click on the CHAT button just below the logo.

 

It's here! (3D Xtra)

Those of you who were at TAAC this year may recall I yelled and screamed really loud to get the Interactive 3D Xtra that was being given away. Well, it's finally here. Download your trial version today!


Spooky!

Tired of photos of anemic office Halloween celebrations? Well, check out my office party. Warning! this is not for the faint of heart. I could not persuade the guy putting it up to "lighten" it any, either, so it may strain your modem a bit.

See if you can figure out which ghoul is me!



  http://www.Authorware-Amy.com