Suggestions on how to do a "count down the days" o

You have completed your first interactive designs with QuarkXPress 7, 8 & 9 and now have need for more advanced functionality. Discuss Expressions here, ask questions and learn more about them.
Please note that Flash (SWF) authoring is not supported in QuarkXPress 10 anymore.
k_ahrendt
Posts: 0
Joined: 17 Aug 2007, 14:29

Suggestions on how to do a "count down the days" o

Post by k_ahrendt » 16 Jan 2008, 10:11

Hi all,
I want to put in a "count down" object in a web page I'm doing to indicate the user has xx number of days to register for an event. Since we had a clock QID example a while ago, is this something that could be modified to do days?
Could you point me in a direction to start with and I'll see if I can figure it out? (Not good at code but I'll give it a try!)
Any help would be greatly appreciated.

Thanks,
Kathy

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

Suggestions on how to do a "count down the days" o

Post by Matthias Guenther (Quark) » 16 Jan 2008, 10:16

Hi, Kathy,

how are you planning to set the date for the event?
Inside the SWF? Or by asking a webserver?

Thanks
Matthias

k_ahrendt
Posts: 0
Joined: 17 Aug 2007, 14:29

Suggestions on how to do a "count down the days" o

Post by k_ahrendt » 16 Jan 2008, 12:51

Matthias,
Now you can understand why I need help! Since I don't know how to set a date on a web server, I guess I'd want to do it inside the SWF.
Thanks for the help.
Kathy

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

Suggestions on how to do a "count down the days" o

Post by Matthias Guenther (Quark) » 16 Jan 2008, 14:59

Hi, Kathy,

ok, I will try some things.

One last question before I jump into it: As months during the year have 30 or 31 days (ignore Feb), would it matter if the accuracy of your countdown might be off by one day in case the count down wraps over a month?

So it would be accurate if you have May 10 and your deadline is May 20, but it might be off one day if the deadline is June 20? I guess it would, hm. Would make it easier though.

Thanks
Matthias

k_ahrendt
Posts: 0
Joined: 17 Aug 2007, 14:29

Suggestions on how to do a "count down the days" o

Post by k_ahrendt » 17 Jan 2008, 05:50

Matthias,
I guess I could probably simplify this and say that what I need is to have the counter start at a specific number -- say 100 and count down from there each 24 hour period.
Then we wouldn't have to deal with which months have extra days. I could control the days remaining at any time by changing the start number of the object.
Sorry I didn't think of this sooner. (Told you I'm not a programmer! )
Thanks for all of your help,
Kathy

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

Suggestions on how to do a "count down the days" o

Post by Matthias Guenther (Quark) » 17 Jan 2008, 11:23

Hi,Kathy,

sorry for all the qeustions beforehand but normally creating the Interactive Layout is not the diffiuclt thing but thinking of how to do it and what issues might arise.

[strong]k_ahrendt:[/strong]I could control the days remaining at any time by changing the start number of the object.
Will the SWF never be restarted? So you start it once on a computer and it keeps running? Or do you put in the web somewhere?

See, the issue is, if the SWF keeps running, then count down is easy. If it is in a web browser, so reloaded every day, then I need to put some calculation in there that looks at "oh, today is Jan 17, so 99 days more to go". Get my dilemma? ;-)

I'll try something, stay tuned.

Thanks
Matthias

k_ahrendt
Posts: 0
Joined: 17 Aug 2007, 14:29

Suggestions on how to do a "count down the days" o

Post by k_ahrendt » 17 Jan 2008, 15:12

I do see the dilemma. Guess that's why I haven't been very successful in getting some of these things done by myself. I don't know the right questions to ask!

My plan is to put this SWF into a webpage on our website so when someone looked at the page a banner at the top would say something like:
You have {SWF Number} days left to register.
At 12:01 each day the number would decrement until it got to 0. The actual number I need to start with is 66 (it will be posted on February 15) and end on April 20.

I had hoped that I wouldn't have to update the page each day and I appreciate all of your effort in this. If this type of thing would be better handled using other tools let me know. I can switch tactics if that would be better.

Thanks,
Kathy

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

Suggestions on how to do a "count down the days" o

Post by Matthias Guenther (Quark) » 17 Jan 2008, 15:58

Hi, Kathy,

Done. That was now easy: QXP here.

I was thinking too big, I thought you wanted a generic solution where you could put in any deadline in the next 10 years.

So, last question before I send it to you:
Is today 94 days left or 95? Or in other words, on April 20 do you want to see 0 or 1 days left?

You can change it yourself in line 3. Here's how (and what restrictions this example has):
- Deadline is hardcoded (April 20).
- If running continuously (e.g. on a dedicated machine), deadline doesnt update automatically at midnight. A refresh will update the date.
- The SWF will give funny results if used before Jan 1st or after Apr 20th.
- On April 20 the countdown shows zero. If you want it to be 1, change line 3 of script to rest=1.

You can change the layout completely, just do not delete the middle (empty)box, where the days appear. You can change font and box though.

Regards
Matthias

k_ahrendt
Posts: 0
Joined: 17 Aug 2007, 14:29

Suggestions on how to do a "count down the days" o

Post by k_ahrendt » 18 Jan 2008, 10:52

Hi Matthias,
Sorry for the delay in reply... life got in the way.

You picked correctly in selecting 0 for April 20. That will work fine.
I will try it out tonight and let you know how it goes

THANKS so much for your work on this. I really appreciate it.
Kathy


Locked

Return to “Expressions”