8 Replies Latest reply on Jan 12, 2009 7:03 AM by RenoRich

    Mac projectors and bundles

    RenoRich
      Hi

      When creating a projector with DMX, it creates projector.osx. Then I would create a bundle (or a .app file) and in Contents/MacOS, I would stick my osx file and all external files including folders with txt files, pngs and casts that my osx file would pull from dynamicaly, then update the info.plist accordingly. All was well.

      Now that I updated to D11, the projector is created in the form of a .app bundle itself. If I have all my external files (txt, png, cct) in the same folder as my projector.app file, all will be well. But our clients want me to have the entire structure to be bundled (as we did before). So now I have no clue as to how to create a bundle, that bundles both the projector.app file, and all my external files that projector.app uses. All my attempts failed.

      Can anybody shed some light on this? I can't find documentation on this.
        • 1. Re: Mac projectors and bundles
          fazstp Level 2
          Is the projector.app created by D11 a bundle? Can you Show Package Contents in Finder and copy the files required into the bundle?

          • 2. Re: Mac projectors and bundles
            RenoRich Level 1
            the projector.app is a bundle. I tried putting my external files in the bundle, I tried putting them in the MacOS folder, in the Resources folder and I tried in the Contents folder...but no matter what I try, the projector does not know how to find them unless I put them in the same folder as the projector.app bundle. Making it impossible for me to bundle both the projector and my files.

            To get to some of my files I use functions from buddy api such as getFile(the moviepath & "fileName.txt"). Does this not work anymore with mac bundles?
            • 3. Re: Mac projectors and bundles
              fazstp Level 2
              You could try putting an alert in the app to show you the actual path it is seeing.

              ie.
              on prepareMovie
              alert( the moviePath )
              end

              In MX2004 I think the moviePath was always the executable in the MacOS folder but maybe this has changed.
              • 4. Re: Mac projectors and bundles
                RenoRich Level 1
                When I do this alert( the moviePath ), it outputs the path that the .app file is in and not the .osx. I guess I could just tell my program where to find files like this getFile(the moviepath & "projector.app::content::resources::fileName"). But I still don't know where to put files that are already linked to my movie (like other movies and flash) in my bundle so that my movie knows how to get to them. It seems like the only place I can put them is next to the projector.app file.

                I found a document on how to work with bundles, hopefully this will help me. I wish though that director would have some documentation on this.

                http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/CFBundles.htm l
                • 5. Re: Mac projectors and bundles
                  garysmith
                  Try adding the Resources folder to the searchpath, and then place your linked files in that fodler.

                  _player.searchPathList = [the applicationPath & the applicationName & ":Contents:Resources"]

                  Gary
                  • 6. Re: Mac projectors and bundles
                    RenoRich Level 1
                    Thanks gary, I didnt know about searchpathList

                    This worked for my flash movies that are linked, director was able to find them in my resource folder... However it did not work for my external cast files. The issue is that, I have my main movie, which is built in the projector. And I have 5 externally linked movies. The movie built in the projector and the 5 linked movies all need to have access to the external cast files. It seems that when I launch the main projector, it looks for the external casts before it even gets a chance to make the _player.searchPathList = .... call.

                    Again I can make it all work if I stick all my files in the same folder as the projector.app file. But the goal is to have the projector, and all files bundled together.
                    • 7. Re: Mac projectors and bundles
                      James Newton, ACP Level 3
                      You could create a stub movie with one handler:

                      on startMovie()
                      _player.searchPathList = [the applicationPath & the applicationName & ":Contents:Resources"]
                      _movie.go(1, "main")
                      end

                      You could then create your projector from this stub movie, and place your "main" movie and all your external casts in the Resources folder inside the package.
                      • 8. Re: Mac projectors and bundles
                        RenoRich Level 1
                        Thanks alot I got all my files bundled up now and everything seems to run fine.