Topic: Right Click/Save As

Hello everyone,

I've been trying to wrap my head around this for a little while now and is there any way possible to setup simpleviewer so you can right click/save an image directly and not have to open it in a new window before saving it?  Or is there a way to set up the "open in a new window" link generated by buildgallery.php to prompt you to save the file?

Any help would be greatly appreciated!

Re: Right Click/Save As

Same here, i really want to enable this option somehow.

i tried the following, but it didnt help me. maybe anyone else can make it work though..

In, line 98 says: 


First, if i disable this line, the ordinary context menu pops up. unfortunately, "save as.." is not an option.

Second, I added the following code: = true;

but that didnt help either.

So, lastly, I think i have to add the option myself. My incomplete and unsuccessfull attempt:

if (mXMLManager.enableRightClickOpen) image_cm.customItems.push(new ContextMenuItem("Save...", Delegate.create(this,doSave)));

I guess this should be okey, so i wish to add the function "doSave" to e.g. line 235. which should be something like:

private function doSave(){
        COMMAND(mXMLManager.imagePath + mXMLManager.imageFileNames[mCurrentImageIndex]); 

[nb. used the getURL as example: line 232:

private function openImageLink(){
        getURL(mXMLManager.imagePath + mXMLManager.imageFileNames[mCurrentImageIndex],"_blank");]

where i need the relevant "Save as..." command (AS? / HTML? / other?) to replace COMMAND.


Re: Right Click/Save As

It's fairly complex to force the browser to download a JPG file. You would need to call a server side script (PHP) to trigger the download. This code will change depending on your server type.

Another option is to zip up your JPGs, then link to the zip from the caption. Opening a zip in a browser will typically cause the 'Save As...' dialog box to open.

Felix Turner
SimpleViewer Support Team.

Re: Right Click/Save As

tnx. any idea how the php scripting is called? so that i can ask my server admin or try to find it online.

however, what i dont understand is that there should be some kind of (crossplatform) code that triggers the save as command in the browser when save as option is selected from the context menu?

Re: Right Click/Save As

anyway, i found another seemingly nifty piece of code to achieve a save as command on jpgs (see below). i havent tried it yet (different computer, no simpleviewer DOT fla available), but i wanted to share it with you already. comments anyone?

However, from the first look of it, in stead of stating the exact path to the file and to its reference (i.e. 'avatertemplate DOT jpg' (which would require constant adaptation) , would it be possible to replace it by a generic name (var?) as so that the generic name is replaced by the adress of the picture loaded into the simpleviewer window, or otherwise replaced by the address and reference as mentioned in the XML file?

import flashDOTnetDOTFileReference; 
var gettheFile = "absolute address avatartemplate DOT jpg"; 
var fileRef:FileReference = new FileReference(); function givemetheFile(){ 
var fileRefDOTdownload(gettheFile, 'avatartemplate DOT jpg') }

myButtonDOTonRelease = function(){ // myButton is just a mc as a button 
givemetheFile(); }

(sorry for the DOT rubbish. website keeps bouncing this post due to alleged spam hyperlinks...)