Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 10th, 2025, 5:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Set Expiry Flex Pub
PostPosted: September 4th, 2006, 3:42 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

Is there any way to set an expiration date after which a Flex pub will not open?

Alternately, is there a way to set an expiration date that when met or exceeded will disable the first page's navigation button "next" so the viewer can not continue to view the remaining pub?

I'm working on a Flash project for handheld devices and am trying to create some means to protect a sample's content after a trial period like 5-30 days.

Any ideas would be appreciated.

Kind Regards,

_________________
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: September 5th, 2006, 4:22 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

I suspect there is not a way to set an expiration date for a Flex pub because I believe that this format cannot when viewed at runtime in a Flash player get the current date from the user's system.

In editor preview, I can set up the expiration, but as mentioned, it won't work in runtime in the Flash player (newest and older versions).

The one option remaining, to set up a password for the SWF file is possible. The difficulty with passwords is that once given out, they become un-secure.

Ah, if only there were a way for the SWF pub in runtime to get the current date, compare it with a set expiration date and not open an expired SWF pub.
Wishlist?

Kind Regards,

_________________
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: September 5th, 2006, 5:02 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
The problem will be storing any imformation - so you would have to hard code the expiry date.
You should be able to do this using something like:
Code:
   var CurrentDate = new Date()
   CurrentDate.setHours(0);
   CurrentDate.setMinutes(0);
   CurrentDate.setSeconds(0);
   
   var StartDate = new Date()
   StartDate.setFullYear(2006)
   StartDate.setMonth(9)
   StartDate.setDate(4)
   StartDate.setHours(0);
   StartDate.setMinutes(0);
   StartDate.setSeconds(0);

   // Compare the times and work out a difference
   //.....

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: September 5th, 2006, 5:58 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

Thanks Duncan for your reply.

At once, it told me that (1) there is hope for a much-needed solution and (2) that, given my limited scripting and mathematical reasoning ability, I can't quite figure it out.

If am unsure if I would calculate the number of hours, minutes and seconds to add, for example, 30 days to a fixed (hard-coded?) StartDate. If Start and Current are then compared, Current will always be greater than Start, triggering a presumed "exit" action. I can't figure out how the runtime program would know the actual date on which it is run?

As you can see, I'm hopelessly lost in trying to abstractly reason this out. I can't seem to get my brain around this yet. (The goal, however, is to set a specific expiration date that is after the release date, so the sample Beta version doesn't "live" forever, especially after much-needed revisions are released.)

Any help, a more specific example for someone abstractly-challenged like me, would be gratefully appreciated.

Kind Regards,

_________________
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: September 5th, 2006, 7:09 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
Stephen wrote:
If am unsure if I would calculate the number of hours, minutes and seconds to add, for example, 30 days to a fixed (hard-coded?) StartDate. If Start and Current are then compared, Current will always be greater than Start, triggering a presumed "exit" action.

Yes - something just like that.

Stephen wrote:
I can't figure out how the runtime program would know the actual date on which it is run?

The current date/time is filled in when a Date object is created - so in the example above CurrentDate is the curent date. It sets the hours/minutes/seconds to 0 so you can comapre sensibly - otherswise you'll get the days changing at an arbitrary time.

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: September 5th, 2006, 7:19 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Duncan

Thank you for your reply.

I've been experimenting based on the script model you've suggested, plus based on a very capable script provided by Oscar Nijst in an April post:

viewtopic.php?t=1689&highlight=expiration

His script goes at the expiration issue a slightly different way, but it seems to achieve the same result. An attached .imp file in Oscar's posting has his script object with that script.

The bottom line is that for a Flex publication, while these work fine in editor preview, once published to Flash and the SWF file run in an up-to-date desktop Adobe/Macromedia Flash player, the scripting functionality is lost. The expiration date script does not work, and I'm unsure why.

Other Forum colleagues may also wish to comment on this Flash/Flex mystery. I'm not knowledgeable enough about how Flash plays to know why these well-constructed scripts won't work in runtime.

Any help will be gratefully appreciated.

Kind Regards,

_________________
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: September 6th, 2006, 1:34 am 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Try this one.
This is one basic control structure for an expiry date, and it works in Flex. I can't see a way around hardwiring the expiry date..

In order to get the date differences, I've converted the raw dates to milliseconds using GetTime(), then to days dividing by (1000*3600*24), so you can display a "days to go message".


I was trying other methods but some date functions don't work in Flex.

I've attached a simple pub, it might be useful.

cheers
Paul


Top
 Profile  
 
 Post subject:
PostPosted: September 6th, 2006, 2:17 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks Paul for your reply and this solution.

It's quite brilliant! I've tried it in runtime, and it works perfectly!

I'm afraid I would have struggled an eternity to try to solve this one and would have been unlikely to devise a working solution even then.

Thanks again.

Kind Regards,

_________________
Stephen


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group