We have an existing app that uses Javascript and embeds flash/flex. We require to make the whole thing work offline at short notice and wonder what the fastest way to make flex work offline is. The offline app in mind would be a window that brings up a web browser with the JS files stored locally. The flex app currently loads mp3 files and data files from the server.
Is there any way to make flex load files from the file system automatically without the user having a web server setup? I know it can be done with AIR but we would prefer not to do that. Also if we are forced to use AIR, is it possible to embed an air application in a web page the same way as you embed a flex app? The flex app is embedded seamlessly as shown here:
Go to www.eyespeakpro.com Click on "free trial" after choosing your gender.
2 Then click on "Conversation in daily life" course, click on the first lesson, click "go"
Ignore that lesson and click on the speech bubble 2nd from the left in the bottom right corner. This brings up the flex app, and if you watch the network traffic you can see the files being downloaded if you click the right arrow for the next sentence etc.
Thanks.
You can run a swf file offline. Due security, an swf file is not allowed to load local files. I'm not sure if you use the external interface with javascript. I don't think a local swf have acces to local javascript.
Have a look to the compiler option 'use-network' (http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a92.html) You may set this option to true for loading local files/mp3's
If you only want to show the application local on known computers, you may have a look at the security manager (Flash < 10.3) http://www.macromedia.com/support/documentation/nl/flashplayer/help/settings_manager04.html#117502 to trust a folder or swf on your computer.
For Flash > 10.3 you should have a look at your config panel to trus a swf (http://www.macromedia.com/support/documentation/nl/flashplayer/help/settings_manager.html)
Related
I'm planning to create an Electron app. The app has content of multiple mp3/png/svg files which are going to be rendered inside the app. I don't want anyone to open an audio or an image outside of the app. I researched a lot to find a solution to protect theses file so that if someone installed the app won't be able to open and use the files outside of my app but it seems that it's not possible...
Note: simple protection solution with minimal security is accepted too...
Note 2: Can we store the files (mp3/ png/svg) without any extension (this way users can not open them directly on their machine) and then open the files via electron app (we have the name and extension stored in our app so we have the extension to attach to preloaded file and open the file) I mean can we preload the audio file without extension and then open the preloaded audio with mp3 format as a work around?
I saw a clever "solution" for protecting multimedia assets back in the days of interactive CD-ROMS.
The trick was to write some junk text to the end of the .mp3 or video file in order to corrupt the file and make it unplayable. Then in the app, to play the file, the file would be written to a temporary directory with the junk text removed so it could be played.
Not foolproof by any means but it prevents casual copying assets out of the app bundle.
I'm currently working on an application that uses the Phonegap/Cordova framework to display an online and an offline version of a website. If you're not familiar w/ this framework, it offers a simple way of creating multi-platform applications by displaying local files in a full-screen webview.
When launching the application, the Javascript integrated in the local files of the application detects if Internet access if available, and redirects the user to either another local webpage containing a full-screen iFrame of the live website, or a reduced offline version of the website (contained in the local files of the app) if no Internet connection is detected.
I would like to detect when the user logs in using the various forms on the website (being displayed inside the iFrame), but I have no way of knowing which page the user is on, or interact w/ the website content at all because of the same-origin policy.
Would it be possible though to make the Javascript from the local page (which contains the iFrame) interact w/ the Javascript from the remote page (which is being displayed in the iFrame)? This way, I would be able to obtain the login information, and save it for later use (obviously not w/o using a token system), but also it would help for another planned feature (trigger the guidance system).
Thank you.
Look into HTML5 communication, it's pretty simple and sounds like it fits your needs
http://stevehanov.ca/blog/index.php?id=109
https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
We are currently looking at porting a enterprise silverlight application over to html5. The major roadblock that we have hit is the ability to open files from the user's local disk. Currently they have a document library which just links to files on their computer that they can open from within the app and view or print out. All that I read is that you can only access the local sandbox of the web app with the html5 file api's. We want to load these files from code.
Does anyone know of any workarounds to this?
Thanks
There is no way for html5 to access local file without user selection. But FSO: FileSystemObject works for IE and MAYBE could be regarded as a work around. But still there are some requirements to meet.
It is possible to use chrome's filesystem API to access files on a users local filesytem. So you'd have to be willing to make this a chrome only application.
Using java you can create a "Signed" applet which has access to the local filesystem. (if the applet is signed you can request filesystm permissions)
then there is a tutorial for accessing methods of your java code directly from javascript here: http://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html
you should be able to perform something similar from silverlight.
There is no workaround in pure HTML5/Javascript. You need the use of plugins, such as Java or Silverlight (maybe you shouldn't port it after all). As for workarounds, HTML5 gives you an easy way drag and drop multiple files that you could transfer on the server and then display back to your users. Another workaround would be to install a custom agent (a software with only a tray icon) that would send the information about the current user "document library" to server and then again, you could display it back to the user.
Note: I've heard somewhere that browsers will eventually stop supporting plugins. http://www.howtogeek.com/179213/why-browser-plug-ins-are-going-away-and-whats-replacing-them/
Ya, I agree with Markain. However, if you were to limit your audience solely to chrome users, I daresay, you would most likely use some of your users. If Huazhihao is right, then your number of leaving customers should decrease but users who regularly use firefox won't be happy. Overall, I think that this will not work. Otherwise, there would be too many websites that trashed your hard driver (or at least wherever you have the rights to edit/delete files). I think it would be best if your product was setup to synchronize the file whenever an internet connection was detected and a change was made to the file. That way the user would not need to visit the website whenever the file was uploaded. If this is some kind of an error file, then it would be most beneficial if you were to make a link in the application that when clicked, would upload the file to the website and the website were to do whatever was necessary. If this is a purely online thing, then I don't see what business you would have looking through other peoples' files =-). Hope I helped!
I have a web app (sencha/phonegap) that includes a feature allowing users to click on buttons that link to Wikipedia articles. This obviously works fine if the device has internet access, but I get numerous requests to make the app work when the app is offline too. To accomplish this, I'd like to give the user the option to download the linked articles/webpages for offline access. When the device does not have internet access, the app would instead display the saved version (which might be stale/out-of-date, but is better than nothing). What are possible ways to accomplish this task?
My first thought was to somehow use the html manifest to cache the pages in the phone's browser, which sounds possible on the Android browser, but iOS apparently has a 5MB browser cache limit - too small.
My next thought was to save the needed html & associated files and bundle them up inside the app. But this seems a rather cumbersome approach, the app becomes much larger than it needs to be, and the webpages are stale back to the date the app was installed.
Using javascript, is it possible to download webpages, which I could then save (on the sd card, for example) for access later?
Or is there a more elegant approach?
If anyone could point me in the right direction it would be much appreciated.
In pure Javascript you can make an Ajax request to download a page. Then you can use the FileWriter to write the responseText to a file on the file system. However, that won't help you when it comes to images. You'll need to use the FileTransfer.download() command to get the binary image files.
If I were you I'd:
Use AJAX to download the html.
Parse the html looking for images.
Use FileTransfer.download to get the images.
I have a project I am doing that requires delivery on a DVD and through the web. I have been using Flash to drive a menu system and javascript to load pages or other actions on the web. However, when I move it to a DVD I receive a Security Error 2060 - the swf is unable to
communicate with the html page it is loaded onto and so none of the javascript is parsed. I am using ExternalInterface calls and jquery on the html page.
Searching online I have made sure that Flash when publishing "Allow local files only" and on the html page I'm using swfobject with a param field of allowscriptaccess of "always" - looking at the generated code on pages it shows that the allowscriptaccess is there.
Is there some security setting that I can program in that will give my Flash application the ability to function the same from a DVD as it would from the web and communicate with Javascript? If I need to compile two different swfs that would be okay.
I suspect you are having a local sandbox problem. Have you gone through the information at http://www.adobe.com/devnet/flashplayer/security.html?
If you can do PC-only, then investigate Server2Go. This is a standalone WAMP stack that works well from a CD/DVD. Your page will then run in the internet zone, and you should not run into the same security problems.