1 person found this helpful
When I create cross platform projects, I always use a movie script that first defines the platform the CD is running in, and then uses the correct delimiter depending on the platform (eg. \ or :)
Just add something along the lines of the following to a script of "movie" type:
on startmovie me
global gPlatform, gDelimiter
if the platform contains "Windows" then
else if the platform contains "Macintosh" then
Then, you could have something like this on a frame script to open the correct file:
on exitFrame me
Like I said, I have use something like this to open documents, I have not tried it for openeing EXEs or APPs, but it should get you started. Also, I use buddy API on this code. You can use buddy API for free is you only use 3 of its behaviors (but it is a good xtra to have).
Hope this helps!
thanks for this Rafa, I'm sure it will help, and I will try this out.
I have been using some buddy xtras to make a student tracking system in my app, but, because one of them won't work on macs I have taken them all out for the mac version (and wiped the sts). I have made it as simple as possible to avoid any errors!!!!!!
as far as I can see, the code i'm using in just 2 lines is exactly the same as your code will generate. Is this right?
the only difference is that I'm not then asking the new movie to actually open, as in your line using ba. (And I'm asking the user to select their own os.)
but, I think something is going wrong before I get that far, because I get a message that the file can't be found, and a chance to browse for it.
sadly, my question still stands: why isn't the file being found?
What happens if you use the platform-agnostic pathname operator:
on exitFrame me _movie.go("@/dswmedia/your_filename_here") end
this seems to work because it opens the stub movie and i don't get an error message, but the application quits instantly. The same for both PC and Mac OSX.
I have set the projector to include the xtras that it needs, so I assume I have the buddy api xtras installed correctly. I find the instructions that are included with these xtras are quite confusing. But I am wondering if that could be the problem.
any suggestions are greatly appreciated. I am really surprised that I am having a problem with this. It shouldn't be that difficult.
thanks for your suggestion Sean, I like the idea of an agnostic solution, but it brings up a "script error" message. Is there a trick to using this?
Pardon my ignorance... Why do you want the user to select the platform him/herself if you can have buddy API do it all behind doors? I dont mean to tell you HOW TO MAKE YOUR PROGRAM, I am just trying to better understand what you are trying to achieve.
... my ignorance! I am just trying to make it work!
I would love buddy api to make it work behind doors, but I haven't been able to do it.
I want it to be as simple as possible for the user so that really is the best solution.
The two seperate lines of code in my original post are simply stripping away everything to get the simplest code just to try to get it to work! And it is obviously too simple, but I don't know why. If one path works on a pc, why wouldn't it work on a mac if I use the : instead of the \ ?
I've spent all night trying to find out why this doesn't work. When I run the projector on the Mac, I get the message "the application Projector quit unexpectedly." When I run it on the pc it just quits without any message.
I was wondering if it was because the app is already open, because the projector is simply trying to open another movie. So I changed it to open a .pdf document, but it is exactly the same, the application quits.
I tried putting in a non-existent file name, hoping it will tell be it can't find the file, but it still quit.
I have got it to work on the dswmedia folder that contains all of my director movies. The folder that it is supposed to work on has shockwaved movies, ie .dcr. The stub moive is the simplest movie with exactly the code you suggested, and one instance of the code in the first frame of the movie, but when I use the projector to open the director movies, even though it works, it seems to open, then close, and then open again successfully, all within 2 to 3 seconds. But it crashes when trying to open the shockwave movie.
Another test was to run this code in the development environment, ie, before I turn the stub movie into the .exe. In the director movie it does nothing. I would have thought that it would open the movie that I want in the dswmedia folder. But it does nothing. Is this right?
You say you haven't used it to open and EXE or APP, but I don't want to open them either. I want this code inside the EXE and APP, and I want it to open a .dcr movie which is inside a folder called dswmedia.
I do appreciate your suggestion Rafa. I hope you or someone can understand what I am trying to do and help me. I still can't understand why it is so difficult. Surely this is quite a common way of delivering and application.
So you have a .dcr file which is the main file (the first one the user sees running), correct? And then this .dcr chooses if its either a Mac or PC, so that it runs either the App or the EXE, correct?
very good question Rafa!
I don't have it like that, quite the opposite.
I had been trying to make a stub movie. And that is why I had the code seperated into 2 different stub movies. Then I started to add the code that you suggested. But I am still making the projectors. So the users are still going to have a choice. I certainly haven't thought it through.
I didn't even think of starting with a .dcr movie.
As a matter of fact, I didn't think you could start with a .dcr. So, is what you are asking me, a workable way of doing this: My user will click on a .dcr that will take them inside a folder and the computer will choose the exe or app?
I will try it and let you know. If it works I will need a bit more help, because the projector distinguishes between osx and classic. Or will the apple computer sort that out for itself?
What is the final delivery method of your project? I have done some crossplatform projects, but they where always delivered on a CD. For this, I just burned a hybrid disc using toast. This basically creates a partion so that if the disc is inserted on a Mac, it only shows the Mac files. If it is inserted on a PC, it only shows the PC files. Is this what you are looking for?
thanks for your prompt reply!
firstly, of course the .dcr can't open by itself, it is a protected file.
My final delivery is on a DVD, the app is a couple of gig so it doesn't fit on a CD. I will be using NTI CD & DVD - Maker 6.5 Gold to burn it.
What you are describing is exactly what I need. So what file format do I need? Am I right with the 3 different projectors for pc osx and classic?
Do you know if there are instructions for doing this anywhere? or is it specific to toast?
You seem to be a little scattered, and I would suggest focussing on one thing at a time.
Forget about how and when to get your projectors onto a DVD until you have them working on their target platforms. Did you get your Mac projector/s to run on OSX and Classic? Since you mentioned Classic/OS9 you must be using D10 - is that correct?
The OSX projector works perfectly on the OSX mac. (I haven't tried the classic yet)
I'm using Director MX 2004.
The OSX projector works perfectly on the OSX mac. (I haven't tried the classic yet)
So the issue you started this thread about has been resolved and you're now moving it on to how to burn your projectors onto a hybrid disc? See this page for lots of good info. Be aware that if you want a true hybrid disc, you will need to burn it from a Mac, preferrably using Toast (I struggled with hdiutil long enough to give up), and that you will have to burn it from a Mac anyway since you can't extract the Mac projectors and move them back to a Windows machine for burning without destroying the resource fork.
"What Sean said..."
I have always burned my crossplatform CD with Toast... I havent encountered any issues and the instructions on doing it are very clear.
thanks so much to Sean and Rafa. The issue might be resolved now, because I was burning the disc using my pc, putting it into the mac and it wouldn't work! I was blaming the path I had used.
You've convinced me, I'm getting Toast right away. My pc and mac are networked so I will burn the files from the pc but using the mac.
All this because I can't swap my copy of Director between platforms!!!!!!! I have to fork out lots of money to buy a second copy.
When it works, I will come back and tick the 'yes' above.
I have downoaded Toast and can see it's a great program that is exactly what I need.
However, my mac version of my program is not working any more!!! I don't know how I got it to work, I might have had the stub movie in the same folder. I'm going to start a new discussion called cross-platform baOpenFile