-
Determine if Mac or PC within a flash projector? (for use with FSCommand)
Determine if Mac or PC within a flash projector? (for use with FSCommand)
How do I determine if a computer is Mac or PC within a flash projector?
I need this because I've got several FSCommands I need to use within a projector (such as launching an application or file) and need to have different commands for Mac and PC.
Code:
if (MAC) {
(do this)
} else if (PC) {
(do this)
}
Anyone know how to do this?
Note: I'm using Flash 8 w/ Actionscript 1 & 2 (?) on a Intel Mac 10.4.11
-
I've found this thread here
http://board.flashkit.com/board/show...67#post4152267
It shows how to do it as of 8/16/2000 ....
Code:
LoadVariables("myfolder\test.txt",0)
If pc eq "true"
Set Variable "os"="pc"
Else
Set Variable "os"="mac"
end if
Anyone know of a better way?
-
Ok ... been testing...
I've created a button in flash that has code to launch an application:
Code:
on (release) {
fscommand("exec", "test.exe");
fscommand("exec", "test.app");
}
It works whether on a mac or a pc. Either platform it launches the appropriate file and I assume it errors out in trying to launch the other file.
Still... does anyone know how to do a proper "if (mac) else if (pc)" statement?
-
I think this thread has the code I'm looking for...
http://board.flashkit.com/board/showthread.php?t=773959
Code:
platform = substring(getVersion(), 1,3);
if (platform == "WIN") {
// we're running on Windows
} else {
// we're running on a MAC
}
I'll have to test it later to see if it works.
-
Tim (Super Moderator)
Now if you wrap that code up into a function and you follow the same naming convention for your MAC and WIN applications, you will end up with a function that looks something like this...
Code:
function SmartExec(target)
{
platform = substring(getVersion(), 1,3);
if (platform == "WIN")
{
// we're running on Windows, target an EXE file
fscommand("exec", target + ".exe");
}
else
{
// we're running on a MAC, target an AppleScript file
fscommand("exec", target + "_script");
}
}
usage: SmartExec("whatever");
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|