Preventing Caching of swf files in Adobe AIR - air

I'm trying to prevent caching of swf files in Adobe AIR application.
The situation is like this, I've my AIR application running and i'm dragging and dropping swf files from external (flex builder) onto AIR application. The swf files are loading. But if i recompile the swf files with some changes and drop the swf file onto already running AIR app, the changes are not reflected instead if i restart the application, the changes are reflected. Here the swf files are loading from the cache and i want to prevent this from happening.
I'd appreciate your thoughts on this.
Thanks,
Swaraj.

Add an unique string to avoid caching:
file.swf?nocache=" + new Date().getTime());

Related

Preserve an external legacy apps file resource fork when including in an Xcode archive

I have created a cocoa application primarily to run on OS 10.6.8. to convert certain types of proprietary legacy files. The app looks at the legacy files creator code and processes it accordingly if it is a known type. Once the file is identified, I call an external legacy app (which I have added to the project) using [NSWorkspace openFile: withApplication: ]to open the droplet and process the file conversion.
The application works just like it is supposed to until I archive it and try to run it from the application bundle. Actually, it will continue to work but it is using the converter app from the project. If I delete the converter in the project area, then the app in the app bundle can not open the external app in that location. One work around is to delete the external app from the bundle after its archived and replace it with a copy of the one in the project area.
I would appreciate any suggestions on resolving this. I'm not sure if the problem is in some Xcode build setting I can change to include an external apps resource fork when archiving, or if this is a launch services issue with apps hidden in packages, or , something I'm not even considering.
Thanks
Mike
Try setting the "Preserves HFS Data" (COPYING_PRESERVES_HFS_DATA) build setting.

AIR how to prevent application descriptor file from reverting or updating on launch

I have a desktop application using NativeProcess and I need the follwoing in the descriptor file.
<supportedProfiles>extendedDesktop desktop</supportedProfiles>
Unfortunately the file keeps reverting to (desktop first)
<supportedProfiles>desktop extendedDesktop </supportedProfiles>
How do I prevent this?
I'm using Flash Builder to launch though compiling using the Flash IDE.
Flash CS is rewriting the list based on the order of the checkboxes in the AIR Settings window. Changing the order of the profiles in the Descriptor.3.x.xsd file won't help. You could set the app.xml file to read-only, as long you don't have to make any other changes. Not a great solution...

How to disable (or be notified of) the deletion of a loaded plugin (NSBundle) file?

I wrote an app with a plugin system (with NSBundle), all is ok but i want to handle the case of when a plugin file is deleted during the app execution.
I think the best way to do that is to disable the deletion of a loaded plugin file (like dll in windows, they can't be deleted when loaded by applications)
But in OSX it's possible to delete the plugin file even if it is used by an app.
Is it possible to disable the deletion of the plugin file when an app uses it ?
Or at least is it possible to be notified when a file is deleted so i can update my app when a plugin file is deleted ?
Thank you
I do not think that you can disable the deletion of a loaded plug-in, but there are possibilities to monitor changes to the file system which may help.
The "File System Events API"
With the File System Events API, your app can be notified if the contents of a specified directory changes. Then you have to scan the directory yourself, e.g. to check which plug-ins still exist or have been removed.
Kernel Queues
This is a more lower-level approach, using the kqueue(), kevent() system calls. You can for example register a file descriptor and will be notified if unlink() was called on the referenced file.
Both mechanisms are described in the File System Events Programming Guide. There is also a sample project Monitoring File Changes with the File System Events API.

How flex modules are loaded into client browser?

When we create a project using modules in flex, how the modules loaded into browser. Say for example I have 4 modules in my project. I build the application and all modules are compiled. On the client side(browser) the application is loaded into the browser. The loaded application contains all the modules. Will all the modules loaded into cache of browser in the begining itself? Or is it like this, default modules loads first. When we click on second module, the previously loaded module unloads and then only requested module gets loaded from server?
When flex application is compiled, it is converted into compiled format which can run in the flash player. This compiled format is the swf file. When a flex application is built without using modules, the whole application is compiled into swf. The size of the swf is larger because it contains the code of whole application. When this is run into the browser, the whole swf is downloaded by the browser. It slows the download process. Therefore the startup time of the application is delayed. When we are using the modules, the individual modules are compiled into separate swf files. The default swf is smaller in size. When the application is run inside the browser, initially the default swf which is the application.swf is downloaded first. Since its size is small the startup time is much lesser. Then other modules are loaded on demand basis. This way only modules which are needed are loaded into the browser.

FLVPlayback not showing skin on exe

I have a problem exporting a flash exe which contains flvplayback with external skin file.
Works fine on swf but on exe, it's not showing the skin controls
I am using Flash CS4.
Any help will be appreciated.
I think the issue is that, as you said in your question, the skin used by Flash CS4 is stored in an external file.
You just have to put the skin file (SteelExternalPlaySeekMute.swf for instance) in the same directory than your .exe file, and it will work (just tested right now).