Hi,
I have client(AIR)-server(Java) application working with many locales. Every now and then someone finds a bug in translation and repairs it.?Whenever somebody updates translation (via other tool wchich also creates new xx_XXresourceModule.swf on the server) it's created new resource module. From this reason I want to have resourceModules located on server. Changing resource on server will spread this change on each client during client initialization. Client during starting checks ''somehow'' whether there is newer resource module on server side and if there is then it should download and loads it.
The reason why I don't want to just call IResourceManager.loadResourceModule(serverURL+resourceModule.swf) every time client start is quicker?client start up. If there isn't newer localization it uses the one which was dowloaded and stored earlier during former start.
The problem is that when I download resourceModule.swf I could store it only into File.documentsDirectory where I have WRITE rights. But later on I am not able to load resource module via IResourceManager.loadResourceModule(). It complains ''Unable to load resource module from: file:///c:/documents and settings/user/MyDocuments/resourceModule.swf'' Do I miss something or is it possible to call loadResourceModule() when the SWF file is located somewhere in myDocument folder?
Any idea how to solve it?
//pyso
Loading resource module from private...AIR had a security restriction that you can only load modules from the app directory (i.e. the same folder the application was installed to). However they added a loadBytes(...) function to allow a module to be loaded that had been downloaded. I don't know if this was added to the resource stuff however.
You cannot blindly add modules to the app directory either (at least ones that weren't part of the initial install) as the AIR runtime tries to work out from the directory whether it needs to update itself, and adding files in there confuses it (so say Adobe).
I actually think you might be stuffed unless you create a new version of your AIR application with the new resource bundle, and distribute it as an update.
Gk.
Gregor Kiddie
Senior Developer
INPS
Tel: 01382 564343
Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ
Registered Number: 1788577
Registered in the UK
Visit our Internet Web site at www.inps.co.uk
The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact is.helpdesk@inps.co.uk
Loading resource module from private...thanks Gregor.
//pyso
ignore this message, see my other post.
You can load a module from any location if you load the bytes of the module instead of just using loadResourceModule()
Aaron Hardy wrote a class that can be used to load the bytes easily.?Check out this link: http://aaronhardy.com/flex/loading-a-remote-style-swf/
I know that it is for loading style modules but you can use it to load other types of modules as well.
I just did a post on it here: http://blog.mediarain.com/2009/08/flex-loading-remote-modules-throws-the-followi ng-error-unable-to-load-resource-module-from/?preview=true%26amp;preview_id=168%26amp;previe w_nonce=75366e9b0d
Hopefully this solves your problem.
No comments:
Post a Comment