On Thursday, Mar 6, 2003, at 04:36 America/Chicago, nik crosina wrote:
Do you think that it is worth developing an educational application for the general public (schools and corporate training) across the globe specifically with OS X in mind or could I do projector for the 'old' Mac OS and have Mac OS X users run it in classic mode?
Make a bundle. It should work on Macs pre-X with CarbonLib, and will run native in X. Updated and useful instructions on the topic are available here:
http://www.macromedia.com/support/director/ts/documents/bundle_proj.htm
Some kind individual passed along to me an ASCII version of the page that the Macromedia IT chimps managed to destroy. Imagine the following with screenshots; it really was a very useful page as opposed to the one they have up now.
Director treats MacOS X and "Classic MacOS" (MacOS 8.6 - 9.x) as separate platforms, requiring separate executables. Many developers have asked if there is a way to combine the two versions of their product into a single app that can be launched on either MacOS X or Classic MacOS; if you only need to target MacOS 9.0 and later, Packages and Bundles provide the mechanism you need. This note is intended as a brief introduction to putting together a cross-platform, bundled projector.
Packages
Packages were introduced with MacOS 9.0 as a way to simplify application folder layout. A Package is a folder hierarchy that closely resembles the usual application folder (containing app, shared libs, support files etc.), but to the casual user it looks like an application: double-click the package and the app inside is launched.
Inside a Package is a Contents folder and an alias to the actual application. For example, a packaged application "foo" might look like this:
foo.app Contents foo fooLib foo.alias
where the actual application "foo", along with its support library "fooLib", live inside a folder named Contents, which itself is placed in the package folder "foo.app". The package folder also contains an alias to the application.
Creating a package is as simple as creating the folders and dragging the pieces into place. Once everything is put together, the outermost folder will take on a custom folder icon with a little parcel in it. You can toggle your package open and closed by right-clicking (control-clicking) the package and selecting "hide package contents" or "show package contents". When contents are shown you get the folder with parcel and double-clicking opens the folder; when contents are hidden the folder takes on the application's icon and double-clicking launches the application.
Bundles
MacOS X bundles take the package idea and add a lot more features, including support for multiple languages and multiple platforms in a single bundle. Bundles were designed to be backwardly compatible with packages under MacOS 9, so we can create a single bundle that contains code for MacOS 9 and MacOS X.
Bundles are layed out like packages, but with a few more items, including an XML file describing the contents. If we ported our "foo" example from MacOS 9 and created a bundle, it would look like this:
foo.app Contents Info.plist Pkginfo MacOS foo fooLib
where "foo" and "fooLib" have been moved down into a folder named "MacOS", and two new files, Info.plist and Pkginfo, have been added to the Contents folder.
Pkginfo is a text file containing the type and creator info for the bundle. If our app had a creator type of 'foo!', the contents of Pkginfo would be "APPLfoo!" exactly.
Info.plist is the file that contains the XML property list describing the bundle. It also contains type/creator info, along with version data, icon and file associations, and the name of the executable (which eliminates the need for an alias). You can create this with a text editor, or using Apple's "Property List Editor," available on the MacOS X Tools disk.
In MacOS X double-clicking a bundle always launches the app. To view the contents, right-click (control-click) the bundle and select "show bundle contents." Most applications in MacOS X are bundles.
Projectors
You can wrap a bundle around any simple CFM-based executable, including a Projector. Standard projectors don't work from within bundles, though; when shared libraries are all packed into the same file, as they are with standard projectors, launching the bundle will result in a "library not found" error. Compressed projectors work okay, but they launch slowly, so it is assumed that most developers will be using Shockwave projectors in a "fast start" layout, with libraries and xtras separate from the projector itself; that's the approach we'll use here.
Our example Projector is a bundle containing stub projectors for MacOS X and MacOS 9, both of which load the same movie "example.dir" which is also contained in the bundle. Example.dir is a simple movie with a text sprite and a vector shape sprite that slide across the stage; the text sprite uses an embedded font.
If we created a MacOS X only bundle with this arrangement, it would look like this:
foo.app Contents Example.dir Info.plist Pkginfo MacOS DPLib IMLLib MacromediaRuntimeLib ProjLib stubX Xtras Flash Asset PPC Font Asset PPC Font Xtra PPC TextAsset PPC TextXtra PPC
The bundle has a Contents folder, which contains the movie "Example.dir", property list "Info.plist", package info file "Pkginfo", and a MacOS folder containing the MacOS X executables. The MacOS folder contains our stub projector "stubX", shared libraries "DP", "IMLLib", "MacromediaRuntimeLib" and "ProjLib", along with an Xtras folder containing MacOS X versions of the Xtras required by Example.dir.
The stub projector (from "stub.dir" provided with the example) contains a single behavior that does a "go to movie". Since the movie is located in the stub's parent directory, we load it as "::example.dir". We named it "stubX" to distinguish it from the MacOS 9 version.
A MacOS 9 Package version of this projector would look similar. Since we know we're going to combine this with the MacOS X bundle, we'll start right off placing the MacOS 9 bits into a "ClassicMacOS" folder, and get something like this:
foo.app Contents Example.dir ClassicMacOS DPLib IMLLib MacromediaRuntimeLib ProjLib stub9 Xtras Flash Asset PPC Font Asset PPC Font Xtra PPC TextAsset PPC TextXtra PPC stub9.alias
There are no Info.plist or Pkginfo files, but we do have an alias to the executable, which is named "stub9". We created stub9 from the same "stub.dir" as the MacOS X version, but when creating the projector we chose "Classic MacOS" as a target. Make sure you strip all Xtras from the stub before creating the projector. You may need to re-create or fix the alias when moving the bundle to another disk; if you're mastering a CD with this content, you may want to create your master from a disk partition image of your CD, so the volume name will be the same.
The MacOS 9 versions of the shared libraries and Xtras are available in the "Classic MacOS" folder inside the "Macromedia Director MX" application folder.
Now we can combine the package and the bundle into one. The complete bundle looks like this:
foo.app Contents Example.dir Info.plist Pkginfo MacOS DPLib IMLLib MacromediaRuntimeLib ProjLib stubX Xtras Flash Asset PPC Font Asset PPC Font Xtra PPC TextAsset PPC TextXtra PPC ClassicMacOS DPLib IMLLib MacromediaRuntimeLib ProjLib stub9 Xtras Flash Asset PPC Font Asset PPC Font Xtra PPC SWA Decompression PPC Xtra TextAsset PPC TextXtra PPC stub9.alias
Two copies of the stub projector, libraries and Xtras; one copy of the actual content.
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
