Skip to main content
Known Participant
August 27, 2011
Question

Cannot select images from iPhoto

  • August 27, 2011
  • 1 reply
  • 872 views

I originally posted this on the Flex forum. I made a desktop AIR application that allows users to upload images  to our server. Everything works except Mac people can't select  images from iPhoto.

This is how I have the file selection setup:

private var fileRefList:FileReferenceList;

private var imageFileTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg)", "*.jpg; *.jpeg");

private var allImageTypes:Array = new Array(imageFileTypes);

https://dl.dropbox.com/u/8709062/4/screenshot.png

I also made an example application that replicates the problem. It actually let's you select iphoto images the first time, but if you try it again the select button (in the  file browser window) is disabled.

UploadImageExample.fxp

UploadImageExample.air

This topic has been closed for replies.

1 reply

Participating Frequently
August 27, 2011

hi,

I'm able to select one or more images from iPhoto libary using your sample, so basically it works as envisioned ("SELECT" button works only when something *is* selected in preview window - so it could be "disabled" when there is nothing selected yet (or something was deselected). Note that sometimes UI is blocked as there could be thousands of images in iPhoto library (but it works much faster then on Windows I think)

#1

have you considered to debug what's wrong using e.g.:

var pending:Boolean = false;

fileRefList = new FileReferenceList();     

try {

     pending = fileRefList.browse(allTypes);

} catch(error:IllegalOperationError) {

     // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/errors/IllegalOperationError.html

     // ActionScript tries to run a FileReference.browse() call when a browse dialog box is already open

} catch(error:ArgumentError) {

     // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/ArgumentError.html

     // The ArgumentError class represents an error that occurs when the arguments supplied

     // in a function do not match the arguments defined for that function. This error occurs,

     // for example, when a function is called with the wrong number of arguments, an argument of the

     // incorrect type, or an invalid argument.

} catch(error:Error) {

     // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Error.html

     // If the method is not called in response to a user action, such as a mouse event or keypress event.

} finally {

     /* */

};

if(pending) {

     // at this point dialog is visible to user and she/he is able to select either:

     // CANCEL or SELECT which are to be handled asynchronously via listeners

};

"pending" == true means that user should be able to select or cancel and you should receive SELECT/CANCEL events asynchronously at some later point in your application

#2

are in any mean accounts on those other macs under some restrictions in privilages, usage access, etc?

regards,

Peter

mattdwmAuthor
Known Participant
August 27, 2011

Did it work when you did it twice? Click "Select Images", pick iPhoto pictures, click "select"... click "Select Images" again, pick iPhoto pictures, click "select".

I'm trying the debug code, but it doesn't seem to be catching any errors.

Participating Frequently
August 27, 2011

Hi,

yes, it works as many times it is invoked (dialog could be unresponsive for short time when selecting multiple content though) not only twice.

If I can suggest something try different content and directory and compare results (the system feature is the same - but content to be selected should be different and at different location).

regards,

Peter