Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Trusted Contributor
Sangram
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha

Loading local images using browseForOpenMultiple

Hi,

 

Is it possible to load the images from the Playbook using 'browseForOpenMultiple'.

 

Does anyone have any working sapmle code for this?

 

Sangram

Retired
rmasroor
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520

Re: Loading local images using browseForOpenMultiple

[ Edited ]

Hello Sangram,

 

Are you referring to the picture app loading multiple images in one screen? or previewing multiple images from within your application?

 

Looking forward to your reply.

Raihan Masroor
BlackBerry Development Advisor
Trusted Contributor
Sangram
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha

Re: Loading local images using browseForOpenMultiple

Thanks a lot for replying.

I have an app and wish to support using local imges from playbook.
Basically it should open 'BrowseForOpen' dialog box and allow user to select imges from playbook, in turn I should be able to load those images in my air application. I even tried with some code, it worked perfectly on desktop air but same did not work on playbook.
It successfuly opened the browse dialog box and i could even select the images. But on clicking ok, it didn't load the images. The same code worked on desktop air app. Also to add I even have added <permission>access_shared<permission>.

Waiting for your reply. Thanks.

Sangram
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Loading local images using browseForOpenMultiple

The BB-tablet.xml files uses <action> now instead of <permission>. I think it still supports <permission> tags, but you should probably update that.
Trusted Contributor
Sangram
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha

Re: Loading local images using browseForOpenMultiple

yes, will take care of that henceforth.

Yet the main, above problem still stands unsolved.
Developer
CoCopia
Posts: 231
Registered: ‎05-03-2011
My Device: PlayBook V1 and proud of it :-)

Re: Loading local images using browseForOpenMultiple

Post up some code, but basically the browseForOpenMultiple() returns an array with the files names to an event, so you need to be registered for selectMultipleEvent to be able to access the array.

 

Also this dialogue is not opened modally, so there's a chance the z ordering could be wrong, not a problem of course if you only have this one dialogue open.

Keep the Forum productive and useful for all. Click Kudos button if I've helped you. Select Solved to help everyone.

PlayBook qualifying app - Pandoras' Lights
Blog - CoCopia.co.uk Catch me on Twitter cocopia_apps
Trusted Contributor
Sangram
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha

Re: Loading local images using browseForOpenMultiple

I guess the Dialog opens modally and don't think it is problem related to z ordering.

I am also listening to selectMultipleEvent and as repeated it works and loads multiple images on desktop pc's correctly. Currently I am out of station and not access to code but will post as possible.
BlackBerry Development Advisor
jdolce
Posts: 172
Registered: ‎10-25-2010
My Device: Not Specified

Re: Loading local images using browseForOpenMultiple

var file:File = new File();
file.addEventListener(FileListEvent.SELECT_MULTIPLE, fileMultipleSelected);
file.browseForOpenMultiple( "open multiple files" );

function fileMultipleSelected( event:FileListEvent ):void
{
        for (var i:int = 0; i < event.files.length; i++) 
	{
		trace(event.files[i].nativePath);
	}
}

I assume that your code looks something similar to this if it works on the desktop. I have tested this on the PlayBook and it does work.

Trusted Contributor
Sangram
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha

Re: Loading local images using browseForOpenMultiple

I guess the code is same but have you tried loading the image with above path?

Once I have access, I would check and reply.

Thanks a lot for looking into it.
Trusted Contributor
Sangram
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha

Re: Loading local images using browseForOpenMultiple

Hi,

 

When I checked on the device, it does not work with event.files[0].nativePath, but if I access event.files[0].url, it works perfectly.

 

I don't know what goes wrong with the nativePath but url works as expected.

 

Thanks all for keeping up with the issue.

 

Sangram