Articles Archive
Articles Search
Director Wiki
 

Welcome to the Lingo Lounge

February 13, 2000
by Gary Rosenzweig

Hello Lingo fans. Welcome to the first weekly installment of the Lingo Lounge. Every week I'll dispense useful tips, tricks and techniques for Lingo programmers. This week, however, I will introduce myself.

I've been using Director since version 3. Remember those days? There was the movie script (only one) and Lingo was not yet a full programming language. I fell in love with Lingo in Director 4, when it began to show promise as a replacement for much more boring languages like C and Pascal.

Somewhere along the way I tried to find a book on Lingo. Disappointed that I couldn't, I wrote one instead. Although that book never got published, my next one did. That began a whole career writing Director books. My latest book published was "Using Director 7" from QUE. I've got two more books on the way in the first half of this year.

I'm not just a guy that writes Director books, though. I actually use Director and Lingo. In fact, I program Lingo code seven days a week. Most of this is for creating the games at http://clevermedia.com/ and affiliated sites. I also do a fair amount of consulting, which keeps me up to date on CD-ROM and kiosk development issues and the like.

So why this column? Well, I've always tried to participate in the Director development community. Since my first book, I've been answering email from other developers seeking advice and help. Pretty soon I found out that when you hand out free advice, you get swamped with requests for it. Seeing that it didn't make sense to give up my job so that I could answer email all day, I started an online discussion forum at http://clevermedia.com/resources/dcr/. By using this forum, many people could get their questions answered by other developers besides me. Then, when I do answer a question, the whole community can benefit, not just the single person.

The next step is this column, the Lingo Lounge. Here, I can dispense Lingo wisdom to an even larger number of developers. I can come up with my own tips and tricks to write about, or answer questions that other developers ask. For larger topics, I will spread the information over two or more consecutive columns.

In future columns, I will address basic Lingo information, undocumented Lingo, advanced programming techniques, Shockwave and CD-ROM development techniques, Director bug workarounds, and anything that I think will be useful to the development community. From time-to-time I may even have "guests" in the Lingo Lounge to tell us about their techniques.

Since I have taken up most of this week's space introducing myself and the column, I'll finish up with a quick tip. Are you frustrated by sound lag on Windows? This is the problem that most developers encounter when they are playing a background sound loop and they also try to play a quick sound on top of that. For instance, if you have a game that has background music looping, and then try to play an explosion sound over it. The result on Windows is that the sound plays as much as a second after you use puppetSound.

There is no sure-fire fix for this in Director 7, but there is one way to significantly improve the situation. Did you know that you can set the soundDevice property so that Director and Shockwave use Microsoft DirectX to mix the sound?

First, use the soundDeviceList to see what is available on the user's system. At the very least, "MacroMix", Director's default sound mixer is available. However, "DirectSound" will be available on many Windows machines, especially ones that are used to play games. In addition, "QT3Mix" will be available on machines that have QuickTime 3 or 4 installed.

Once you check the list returned by the soundDeviceList, you can set the soundDevice to something better than "MacroMix". Currently, if you try to set the sound to something that is not available, the soundDevice will just revert to "MacroMix". So you could just add this line to your on startMovie or on prepareMovie handler:

the soundDevice = "DirectSound"

However, to play it safe, I like to check to make sure that the sound device is available before setting it:

if getOne(the soundDeviceList, "DirectSound") then
  the soundDevice = "DirectSound"
else if getOne(the soundDeviceList,"QT3Mix") then
  the soundDevice = "QT3Mix"
end if

Performance of sound will now depend on the version of DirectX or QuickTime and how well it is integrated with the user's hardware. At the worst, I have heard it behave exactly as MacroMix would. At best, I have heard the lag go away almost completely.

If you have a topic that you would like to see The Lingo Lounge address, you can email me at lingolounge / at / director-online.com. However, since there is only one column per week, I suggest you use the forum that I mentioned above, or to DOUGthreads, for specific questions you may have.

Gary Rosenzweig is the Chief Engineer, founder, and owner of CleverMedia, a game and multimedia development company in Denver, Colorado. He is the author of ten books on Macromedia Director and Flash, including his latest, Special Edition Using Director MX.

Copyright 1997-2024, Director Online. Article content copyright by respective authors.