0
votes

I created an Air desktop app with Flash CS 5. Usually Windows (XP) is opening an application (like Firefox) with the latest set size and position. For my installed Air app it's always just the default one.

How to start it with the latest used size and position?

Thanks. Uli

3

3 Answers

0
votes

You need to save a record somewhere that remembers the window's size, and possibly position. If your app has a preferences file, this would be an ideal place to store that information. Then, whenever your app starts, it checks for this information and resizes the window if any values are found.

Most popular programs include this feature (and don't even mention it, since it's pretty basic UI), but it's done intentionally and not as a default for every application. Thus if you want it, you have to program it in.

0
votes

You can read and write to application.xml. You'll find there and nodes.

file = new File( File.applicationDirectory.nativePath + "/META-INF/AIR/application.xml" );

Adobe restrict writing access to application diractory but this trick is useful if you don't want to create a separate config file in app-storage:/ folder, which is of course prefered.