Unknown Domain

HOW TO: Detect operating system in Flash

Using the following if statement you can test which operating system your currently within, great for my current project where the USB memory stick my projector will be running from needs to have 2 partitions and I want to be able to access the assets from the Windows FAT32 partition from Mac OS X's HFS partition.

if (System.capabilities.os.substr(0, 3) == "Win") {

// Windows code

} else if (System.capabilities.os.substr(0, 3) == "Mac") {

// Mac code

}

This code combined with my previous post's code allows me to calculate the current path to my resources folder for Windows and if on Mac to simply use a hard coded path as Mac does not have random drive names, it uses the standard of /Volumes/disk name.