Hi everybody,
I had a quick question. I have a flash website I made for a company I have not gotten any payment for it yet. They asked me to design a site for them and present it to them. They would like to see it on CD-ROM. I would like to protect myself from them taking it and using it for free. Does anyone have any sugeestions on how I can protect the files from being used. I was thinking if there was a way of putting an experation date on the .swf files or the projector files. This way the files don't work after a certain date. Thank you for your help.
Suggest you don't supply any .fla and/or projector files, but only a .swf. I'd also add a semi-transparent BIG "DEMO" text (even with your name on it), across the whole stage area, so they wouldn't really be able to use the .swf on it's own.
Of course, they can allways hire someone, using 3rd party software, and decipher your code and re-create your project from scratch, but then wouldn't it be easier to just pay you?
This probably too late for Keith30, but might be useful to others. Any suggestions on improvements are welcome.
Of course, as Oldnewbie says, all protection schemes eventually fail, but this is another layer.
***********
My protection scheme basically "expires" the .swf after a certain date. After the set date, the user gets an "expired" message. Of course, the easy way around this is to simply set your clock date back. So, in my code, a SharedObject is created that is written to the hard drive. This code keeps track of the latest date that the user accessed the course. If the date on their computer is before that date, it assumes that the user has moved their clock date back, and the .swf defaults to the later date. The code is below.
Give it a try. Set your date that you want it to expire, then set your computer date past the expiration date and try to run it. It should jump you to the frame number you designate. Then, reset your date back to before the expiration date and try to run it. You should get the same results.
*****
1) On the main timeline there is an MC called DateCheck (with nothing in the MC, just code on the timeline).
2) In DateCheck, on frame 1, there is the following code:
// This actionscript is used to see if the user has set the date back
// on their computer.
D4XSO.data.datelastaccessed = new Date();
// Opens the shared object called "datesharedobject.sol".
D4XSO = sharedobject.getLocal("datesharedobject");
// Set "now" equal to the date on the users computer
var now = new Date();
if (now< D4XSO.data.datelastaccessed) {
// If the computer date (now) is less than the date last accessed,
// then the date has probably been set backwards on the users computer,
// so set "now" forward to that last accessed date so they can't
// access the course.
var now = D4XSO.data.datelastaccessed;
trace("Today's date (now) is being set to the datesharedobject date, which means the computer was set back; =");
trace (D4XSO.data.datelastaccessed);
trace ("Which should equal what now has been set to, which is:");
trace (now);
// Else if the computer date (now) is greater than the last date accessed,
// then all is right with the world, so go ahead and write that date
// back to the shared object as the date last accessed.
} else {
D4XSO.data.datelastaccessed = now;
D4XSO.flush();
trace("The datesharedobject date is being updated to today's date =");
trace(D4XSO.data.datelastaccessed);
}
3) On frame 20 (or so, on a 12 frame per second swf), is the following code (note, I tried putting this code on frame 2, but it seemed to be buggy. My theory was that there wasn't enough time to process the first code, so it needed some lag time to process).
var start = new Date(2003, 10, 1);
// set start equal to 11/1/2003 (Jan = 0)
var end = new Date(2004, 6, 15);
// set end equal to 7/15/04; do not put zeros in front of numbers
if (now<start) {
// if date is before start, then they're trying to cheat us, so give error message
trace ("If you're seeing this then the now is before the START date, meaning they've set the clock back too far.");
trace ("The START date is:");
trace (start);
trace ("Today's date (now) is set at:");
trace (now);
_root.gotoAndStop(31);
} else if (now>end) {
// if date is after end, then go to end
trace ("If you're seeing this then the now is before the END date");
trace ("The END date is:");
trace (end);
trace ("Today's date (now) is set at:");
trace (now);
_root.gotoAndStop(31);
} else {
trace ("Everything is hunky-dorey, let's go!");
play();
}
stop();
you could use a SO with a max number of views before the expired shows up. Also make sure the SO references the same folder ever time so even if they post it online, the SO will reference the same SO.
and/or do an url test to see where the file actually is, and only let it be valid if it is played off of a/the CD.
Hi all,
As for posting the .fla, it's too big to upload (I believe there's a limit on upload size). In any case, all the code is in the previous posting. You should just be able to cut and paste per the instructions.
Spacether, thanks for the input. One question, I haven't referenced a folder in my code, I've just let Flash handle which folder it goes in. The concern I had about explicitly referencing a folder is how to do it without causing problems. Wouldn't the reference have to be different for a Mac vs. a PC vs. a Linux machine? Obviously I couldn't reference the folder as c://program files/.... *** So how would I reference it? ***
I have made the fla file but i'm not having any luck, i'm now what the MC clip is and where to put is is it a graphic that is labled. I'm kind of lost...
Keith30,
I received the file you emailed me. The problem was that there needed to be a Movie Clip called DateCheck (or whatever you want to call it) on the main timeline with the code in it. I've fixed the file and posted it here. Let me know (by posting) that it works for you. Good luck.
If you or anyone else has suggestions or improvements, please post them on this thread. Thanks.
Thanks for the file but I'm have a touble with is working in January 2004
I tried to put a one day expiration on it and it did not work.
Did several combinations of it in January and it did not work.
But if I set it up to expire in 2003 it works fine.
I dont understand the problem.
The reason for the need for this was to give a time limit of it on a CD for maximum of a week. Just a demo to give to a client and it would expire in a week.
You could have the date set wrong. In Flash, January is "0", February is "1" and so on (I don't really understand why it's done that way, but it is).
So if you want it to expire on January 30, you would need to put 2004/0/30. For February 1, you would put 2004/1/1. Note that you shouldn't put any leading zeroes (e.g., 2004/01/01). I did this and it seemed not to work. Not sure why.
See if that works. Also, where are you located? I have had some European users have problems with the code. Their problem was that it would give them the license expired message even when it hadn't.
Mark
P.S. From a business perspective, I would suggest giving them longer than a week, if possible. Maybe a month or so. It may sit on their desk a week before they even take a look at it, or they might be on vacation, or they might just want to show it to others.
I have an idea but not sure how hard it is to impliment.
Can put a code in for a 2 days before it expires as a warning that is will expire in 2 day click here to continue?
This would work great for Flash Trail Software Development.
Because you can have a 30 day trial and have a 14 day warning and 2 day warning. It will expire in 2 weeks and will expire in 2 days.
What do you think?
Your question fro earlier.
I'm here in New Jersey USA
Keith,
You could certainly put the code in to give a warning. Just need to put an "If" statement in that will jump to a different message if within two days of expiration.