Showing posts with label Adobe AIR. Show all posts
Showing posts with label Adobe AIR. Show all posts

Thursday, July 10, 2008

Avoid Spaces in PDF File Names in Adobe AIR on OS X

Another odd quirk of an Adobe AIR application running in OS X is that it will not display a PDF if there is a space in the file name.

I had a menu item which would pop up a new native window, and display a PDF in that window by setting the location of an HTML component to the PDF file. This would work fine on Windows, but the window would launch with a black screen on OS X if there was a space in the filename of the PDF.

Removing the space fixed the problem.

FlexNativeMenu and Mac OS X

I don't know whether this is an Apple standard, or just a quirk, but Adobe AIR menus need to be a little more complicated to work in OS X.

In Windows, one can have a menu which does not have any sub-items, but which simply works as if it were a button in the menu bar. For example, when my application ran in Windows, it would display the following top-level menus: Observations, Account, Schools, Reports, and Help. The Account menu did not contain any items, but clicking Account would load the account page.

However, in OS X, it would display Observa... and the rest of the menu bar would be blank. Further, clicking the Observations menu would not work.

After much trial and error, I discovered that OS X did not like the single-item menus.

To get around this, I had to give the Account menu a sub-item so that clicking that menu would open it, and one could then click on the only item in the menu. In other words, one would open the Account menu, and then click on the Profile item within that menu. Once I made that change, everything worked the same on both Windows and OS X.