A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 29

Thread: flash file protection

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    536

    flash file protection

    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.

    Keith

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Well... All protections eventually fail!

    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?

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    does anyone know how to put an expiration date on a flash swf file, i want to protect the file as many ways as i can. thanks

  4. #4
    Member
    Join Date
    May 2001
    Posts
    69
    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();
    Last edited by mvmartin; 01-28-2004 at 12:55 PM.

  5. #5
    Peace - Just in Heaven koolbabs2000's Avatar
    Join Date
    Nov 2000
    Location
    Somewhere in Time
    Posts
    148
    Hi mvmartin,
    Thanx for the code man..
    But Im pretty bad at coding.
    Can U please upload the .fla
    Thanx in advance,
    Cheers.
    An eye for an eye makes the whole world blind
    - The Mahatma.

  6. #6
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    Hi mvmartin

    It's never too late.
    thanks for you efforts.
    I am also an beginner at code.

    I would also appreciate you uploading a sample fla file.

    Thanks :-)

  7. #7
    Member
    Join Date
    Jul 2001
    Posts
    91
    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.

  8. #8
    Member
    Join Date
    May 2001
    Posts
    69
    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? ***

    Thanks.

  9. #9
    Member
    Join Date
    Jul 2001
    Posts
    91
    I haven't done it yet, but I'll find the post... here:
    Macromedia: http://www.macromedia.com/support/fl...s/local_so.htm

  10. #10
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    Nice work marv!
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  11. #11
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    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...

    Please check my fla file

    Thanks
    Attached Files Attached Files

  12. #12
    Member
    Join Date
    May 2001
    Posts
    69
    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.

    mvm
    Attached Files Attached Files

  13. #13
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    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 know what I mean?

    Is there something I'm doing wrong?

  14. #14
    Member
    Join Date
    May 2001
    Posts
    69
    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.

  15. #15
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    Thanks MV
    This works now for me.

    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

    Thanks

    Keith

  16. #16
    Member
    Join Date
    May 2001
    Posts
    69
    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.

    Good luck.

  17. #17
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    is there a certain place you reccommmend I put the IF statement?

  18. #18
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    Frame 1.
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  19. #19
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Check this. This is how I make demo versions of my files. Here is an example. You have to download.
    http://flashscript.biz/components/mp...yerstream.html

    You can buy it too

    I'll also be interested how safe it is.
    - The right of the People to create Flash movies shall not be infringed. -

  20. #20
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    In frame 1 of the main time?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center