Xtra FAQ

From Director Online Wiki
Jump to: navigation, search

Question

My movie works fine in Director but when I run it in a projector, I get an alert saying "Script error: handler not found". Why?

Answer

One of the first things to check is whether your movie uses a Script Xtra. If you have not embedded the xtra in your projector or (better) added it to an external Xtras folder, the projector will not be able to use any of the xtra's methods. Here's a simple script that you can use to ensure that all your Script Xtras are present:

on startMovie()
  vXtrasList = [#fileio, #FileXtra4, #BudAPI] -- see note below
  if XtrasMissing(vXtrasList) then
    alert "The following Script Xtras are missing:"&RETURN&vXtrasList
  end if
end startMovie,br>
on XtrasMissing(anXtrasList) -----------------------------------------
  -- INPUT: <anXtrasList> should be a list of string or (preferably)
  --         symbol xtra names
  -- OUTPUT: Returns TRUE if any of the xtras in xtraList are
  --         missing.  Once the handler has finished executing,
  --         xtrasList contains only the names of the missing xtras.
  --------------------------------------------------------------------
  i = the number of xtras
  repeat while i
    anXtrasList.deleteOne(xtra(i).name)
    i = i - 1
  end repeat
  return anXtrasList.count()
end XtrasMissing

Note

You modify vXtraList so that it contains the names of the Script Xtras that you need in your movie. If you use symbols, the xtra names will not be case-sensitive?: Director will treat #FILEIO the same as #fileio. If you use strings, then you must be sure that you use exactly the right mix of cases. When working with lists, Director does not consider "FILEIO" to be equivalent to "fileio".

If you are in any doubt, test the name of the xtra in the Message window, and the copy and paste the output into vXtraList:

put xtra("FileIO")
-- <Xtra "fileio" 0 83d442c>
put #FileIO
-- #fileio

Download

You can download an Xtra Broker Script that will help you take care of this issue automatically:Macintosh [[1]] or Windows [[2]]


Question - Rosetta Support?

I'm concerned that the xtras in my project may not function running on an Intel Mac under the Rosetta emulator. Is there a list of xtras that work under in the Rosetta environment?

Answer

Here is a list of xtras known to function on Intel Macs running in emulation mode:

Audio Xtra
baWindows OSX Xtra
Buddy API OSX Xtra
FileIO PPC Xtra
Flash Asset PPC
Font Asset PPC
Font Xtra PPC
Impressario
InetUrl PPC Xtra
Mix Services
Mui Dialog
NetFile PPC Xtra
NetLingo PPC Xtra
OSControl Xtra
PDF Xtra
PRegEx
PrintOMatic Lite MX
QuickTime Asset
SWA Decompression PPC Xtra
SWA Import Export
SWA Streaming PPC Xtra
Sound Control
Sound Import Export
TextAsset PPC
TextXtra PPC
UIHelper PPC Xtra
V12 Database Xtra
XmlParser PPC Xtra