Miscellaneous


Stuff that didn't neatly fit elsewhere.

Scrolling Text

If you have a scrolling text field in your movie, the field will keep the scroll setting if you navigate away from the frame with the field, and then go back to it. If you want the text to scroll back to the top of the field, you can use a line of Lingo attached to the field:

 on beginSprite me   sprite(me.spriteNum).member.scrollTop = 0 end 

Pre-Sorting Lists

In Director, you can sort a list by running the list object's sort method:

 myList = [] myList.sort() 

The cool thing about sorting an empty list is that from the moment you run the sort method, the sort flag is turned on and any new items you add to the list are automatically added in sorted order.

BuddyAPI

BuddyAPI is an indispensable Xtra for Director that provides nearly 150 different functions for dealing with the Windows API and the Macintosh Toolbox.

Using BuddyAPI you can read and write registry and ini files. You can poll system information like processor speed and clock settings. You can control windows, the keyboard, and even other applications.

Go to www.mods.com.au to read more about BuddyAPI, and to download an evaluation copy.

Use Breakpoints

Although not covered in the text, you can set breakpoints in your code to stop your movie at a specific line and open the Debugger window. As shown here, you can click on a line number in the Script window to set a break point:

Once a breakpoint has been set the movie will stop, and the debugger will open, when that line of code is executed. Click a breakpoint that has been set, to remove it. You can also select Control > Remove All Breakpoints to remove all breakpoints at once.

Using breakpoints can help you quickly find errors in your code. The debugger will list all variables and their values, and allow your code to execute line by line.



Macromedia Director MX 2004. Training from the Source
Macromedia Director MX 2004: Training from the Source
ISBN: 0321223659
EAN: 2147483647
Year: 2003
Pages: 166
Authors: Dave Mennenoh

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net