2 Replies Latest reply on Dec 29, 2006 11:08 AM by zadig007

    openFile error

      Again a problem when transferring a project from 8.5 to MX (on Mac OSX)...
      I want to open an image file and import it into a cast member. The following code works perfectly well in Dir 8.5...
      ... AND also within Dir MX:

      on mouseUp me -- attached to button "Open File"
      vfileObj = new(xtra "FileIO")
      vFilename = displayOpen(vfileObj)
      openFile (vfileObj, vFilename, 1)
      if status(vfileObj) <> 0 then
      -- alert message if necessary
      importFileInto member(3), vFileName
      end if
      vfileObj = 0

      But when the movie is compiled ("published"), I get the message "Director Player error!"
      What's wrong then, since the code works when building the project in MX?? Any help much appreciated!
      Thanks in advance,

        • 1. Re: openFile error
          Level 7
          Since you are using the fileIO xtra, you need to include that xtra with
          your project. There are 2 ways to do that.

          1) Compile it internally into the projector itself: Click on Modify,
          Movies, Xtras. In the dialog that shows up, click on Add... Pick FileIO
          from the list and hit OK. Make sure it has the "Include in Projector"
          box checked. Hit OK.

          2) Include it in an external xtras folder: find the fileIO xtra on your
          computer (generally on PC, it is in the director\xtras\scripting or
          director\configuration\xtras\scripting folder). Copy that file and
          paste it into a folder named "xtras" which is in the same location as
          your projector (you may need to create the folder if it isn't there already)

          There are pros and cons to each method, choose the one that works best
          for you. You can read about managing xtras in the help file.
          • 2. Re: openFile error
            zadig007 Level 1
            Fantastic! it works!!!
            Method 1 seems safer... anyway, I learnt something useful to-day.
            Many thanks and Happy New Year to everybody!