I’m trying to make an app that can work on multiple devices. Desktop, Mobile and the Web.
I’m building it using the latest Flex Mobile SDKs as well as Robotlegs.
What I’m looking for here is a best practice to load a file either from the user’s computer or from their mobile device in all environments. Normally, if I was making a simple desktop or mobile AIR app I would just use the FileReference class. However I’m also looking for a way that I can also do this on the web.
Is this possible? Is there a way to have a single class in my core Library project that can load the file and detect which system is being used?
Ideally I can make a single service called LoadSoundFromUserDevice which would then return the sound file the rest of my app. I’m also making an ILoadSoundFromService so that I can load a sound from another website, or from an internal database in the app. But I’m not sure how to go about this properly. Thank you for your help.
It turns out that using the basic flash class of FileReference works well for both desktop, web and Mobile devices.
Unless there is a need to use File instead of FileReference that will work, but for my question File is not needed.