Old 05-31-2008, 03:47 PM   #1 (permalink)
Junior Member
 
Join Date: May 2008
Posts: 6
Default having trouble with the disable saveimage feature

I have set this up so that I have multiple galleries whereby a new swf file is loaded in by way of a separate nav bar I've created. My problem is that I want some of the galleries to allow the user to save the images, and some of the galleries I do not. So, I put the .fla files of the galleries I want to save image into one directory along with the .as files, and then the others into their own folder with the .as files. I then changed the picture.as file code to:

// allow image save
private var allowSave:Boolean = false;

I then published each of those files that I wanted to not be able to save. All the .swf files reside in the same directory on the server. The problem I'm having is that it is not working. Seems no matter what I do, it still allows the user to save the image. Is there something that I'm missing? Is there something else I need to change?

thanks for your help. This is a fantastic gallery, by the way.
festermonkey is offline   Reply With Quote
Old 05-31-2008, 09:43 PM   #2 (permalink)
OYXLUSFlash.com Staff Member
 
Adrian's Avatar
 
Join Date: May 2008
Posts: 1,981
Send a message via Yahoo to Adrian Send a message via Skype™ to Adrian
Default

This can be fixed easely.Open the Picture.as file and search for the methods named addSave() and addSaveDisabled(). At the top of this functions just write the following line:

Code:
if(!allowSave) return;

It should look like this:

Code:
private function addSave() {
        if(!allowSave) return;
        ..............................
}
private function addSaveDisabled() {
        if(!allowSave) return;
        ..............................
}
Adrian is offline   Reply With Quote
Old 05-31-2008, 10:16 PM   #3 (permalink)
Junior Member
 
Join Date: May 2008
Posts: 6
Default

huh. tried that. still have the same problem.

The way I have it setup is the default for the page(s) is set to not allow save image. If they right click on the image, the context menu reads: "save is disabled, please login to save images"

but it still allows me to save the image.

If I login (which just loads a new version of the same page, but made with the picture.as set to false for the saveimage thing, it still reads the same way:

"save is disabled, please login to save images"

when the message I put in the private var sistr:String = "save image"

it's as if it is not reading the picture.as file correctly.

I know that it is loading the new .swf file because there are some different graphics on that version. Any idea why this isn't working? I really appreciate your help.
festermonkey is offline   Reply With Quote
Old 05-31-2008, 10:19 PM   #4 (permalink)
Junior Member
 
Join Date: May 2008
Posts: 6
Default

so if I login before I go to this section, it acts correctly. It shows the context menu as "save image"

If I login after I go to this section, it reads as I described in the previous post. weird. But, at any rate, it still allows the save even on the the files I set the save image to false on.
festermonkey is offline   Reply With Quote
Old 05-31-2008, 11:31 PM   #5 (permalink)
Junior Member
 
Join Date: May 2008
Posts: 6
Default

so the change to the allow save should read this if you don't want it to save, right?:

// allow image save
private var allowSave:Boolean = false;
festermonkey is offline   Reply With Quote
Old 06-02-2008, 08:05 AM   #6 (permalink)
OYXLUSFlash.com Staff Member
 
Adrian's Avatar
 
Join Date: May 2008
Posts: 1,981
Send a message via Yahoo to Adrian Send a message via Skype™ to Adrian
Default

Have you recompiled the whole project after you have made the changes ? Those .as files are source code files, not files from where the swf reads data. So after every change you should save and republish the swf.
Adrian is offline   Reply With Quote
Old 06-02-2008, 01:48 PM   #7 (permalink)
Junior Member
 
Join Date: May 2008
Posts: 6
Default

yes, I published a new swf after modifying the .as file. I don't understand what the problem is.
festermonkey is offline   Reply With Quote
Old 06-02-2008, 04:36 PM   #8 (permalink)
OYXLUSFlash.com Staff Member
 
Adrian's Avatar
 
Join Date: May 2008
Posts: 1,981
Send a message via Yahoo to Adrian Send a message via Skype™ to Adrian
Default

Quote:
Originally Posted by festermonkey View Post
If I login (which just loads a new version of the same page, but made with the picture.as set to false for the saveimage thing, it still reads the same way:

"save is disabled, please login to save images"
Where do you login ? I don't undersatnd what you are talking about. Where do you get this message ? "save is disabled, please login to save images"
Adrian is offline   Reply With Quote
Old 06-02-2008, 05:21 PM   #9 (permalink)
Junior Member
 
Join Date: May 2008
Posts: 6
Default

So, I created a login button to change from the versions without the ability to save, to the versions where you can save. By clicking on the login button, and logging in, it loads new versions of the swf files with the picture.as file set to the save feature as true. In the picture.as code, there's a line where you can edit what the contextual drop down menu reads. (line 15 in the code - private var sistr:String = "save image..."; ) The default was set to "save image". On the version where I want to disable the save image feature, I couldn't get it to work, (if I set the save image to false, (line 13 in code) I can still see the drop down menu, so I changed the string to read "save is disabled...)

so I know it has loaded the swf that I made with the save feature disabled, but the save feature is not getting disabled. I can still save the image.
festermonkey is offline   Reply With Quote
Old 06-07-2008, 07:06 AM   #10 (permalink)
OYXLUSFlash.com Staff Member
 
Adrian's Avatar
 
Join Date: May 2008
Posts: 1,981
Send a message via Yahoo to Adrian Send a message via Skype™ to Adrian
Default

Hi,
Have you modified the code in the way I told you for the version with save disabled ? Try also removing the code inside those methods (addSave and addSaveDisabled).
Adrian is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:56 PM.