Articles Archive
Articles Search
Director Wiki
 

External casts

August 10, 1998
by Pat McClellan

Dear Multimedia Handyman,

I am about to start working with a CD-ROM that will be produced in one language first and later (probably) be converted to other languages. What should I think about at the beginning to avoid dubblework when adopting to other languages? There will be no speaker. Only text fields will be converted in the future.

Ingemar Edfalk

Ingemar

Good foresight on your part to be thinking of this aspect of the program up front. Too many times, clients and developers make this translingual task harder than it has to be, simply by not planning for it. You mention that only text fields will be affected, which makes the translation work easy, but the approach I will suggest is just as easy to execute (not counting the additional media production) with audio clips, rich text members, and even bitmapped graphics.

When Macromedia introduced external casts to Director, they must have been thinking about our situation. External casts are perfect for segmenting and organizing your media. I generally organize my media in external casts by type: interface elements, art, sound, digital video, scripts, text, etc. It's really up to you to decide the best way to organize your casts for your specific project. In the multilingual situation, I would isolate all language specific elements into a separate cast.

To create an external cast, go to Director's cast window and click on the top left icon. A pulldown menu will allow you to select "New cast...". This will open the following dialog box:

Name your cast -- "Text" in this example -- and select External. NOTE: the name of your cast is "Text". This is not the filename of the cast file. This is a very important distinction, as I am about to explain.

Select the window of the new cast named "Text" and select "Save" from the file menu. When you do, the standard SAVE dialog box opens, asking you to name the file. The filename will default to the same name that you gave to the cast "Text", but in this case, we want to give it a different, language specific filename. Let's call this one "swedish.cst".

As you can see in the graphic above, we can create a parallel cast for each language that we want to include. Note below that, even though we have multiple language casts, there is still only one cast linked to our movie called "Text".

If you select that cast and click on the Properties button, you'll see that the filename of the Text cast is currently set to "swedish.cst".

Now comes the Lingo. Let's say that you want your user to be able to select the language of their preference. So you create a screen that says (in multiple languages, of course) "Pick a language." You provide buttons -- perhaps as flag icons -- for each of the languages available. Attach a variation of the following script to each button. This one is for the English button.


on mouseUp
  set the filename of castLib "Text" to the ¬ 
    moviePath & "english.cst"
end

Everytime you save your movie, it will save the link between the "Text" cast and whichever external cast was linked at the time. To avoid constant switching of casts, I suggest adding the following to your startMovie and stopMovie scripts. I'll assume Swedish is the default language in our example.


on startMovie
  set the filename of castLib "Text" to the ¬
    moviePath & "swedish.cst"
end
on stopMovie
  set the filename of castLib "Text" to the ¬
    moviePath & "swedish.cst"
end     

That's it. Easy. Now, some guidelines in creating the parallel casts.

  1. Create your movie using a single cast for the language specific members. Make sure that everything works before moving on to the next language. In our example, cast "Text" is currently linked to "swedish.cst".
  2. Save the language specific cast under a different filename. We save "swedish.cst" as "french.cst" -- even though it is still in Swedish. Repeat this step, creating a cast file for each language that you will need.
  3. Change the filename of the language specific cast using Modify -> Movie -> Casts, Properties. In our example, "Text" will now be linked to "french.cst".
  4. Very Important: do not move, add, or delete anything from either language specific cast without making a parallel change to ALL other language specific casts. The score of your movie doesn't know or care which language you use. It only knows that it needs memberNum X of castLib "Text". Therefore, if you move things around, your memberNum references won't match from cast to cast. Nightmare.
  5. Methodically, move through "french.cst" replacing each Swedish member with the corresponding French member. I advise you NOT to change the names of the members, just in case some of your Lingo refers to a member by name. Note that many behaviors refer to members by name, so even if you don't refer to them be name in your code, some of the stock behaviors you use could.
  6. When you have replaced all of the Swedish members with French, thoroughly test your program. Watch for members which show up in places they shouldn't. This would indicate that things were moved in one cast so that they don't match the other cast.
  7. After everything works with cast #2, go back and check cast #1. If evertyhing works well there, move on to cast #3. Test, retest, double check that nothing got messed up.

Following this tedious process is essential to assure that you won't run into odd text showing up where it shouldn't. As you see, the hardest part of this is not the Lingo, but the obsessive attention to maintaining exactly matching external casts. Good luck with your project.

Patrick McClellan is Director Online's co-founder. Pat is Vice President, Managing Director for Jack Morton Worldwide, a global experiential marketing company. He is responsible for the San Francisco office, which helps major technology clients to develop marketing communications programs to reach enterprise and consumer audiences.

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