00:00
00:00
Newgrounds Background Image Theme

Dingleberry96 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Serious help before Halloween pleas

2,646 Views | 52 Replies
New Topic Respond to this Topic

Hi if there's any action scriptur out there I have a file I will be willing to send to you if you can help me out and fix it for me on it. I have Adobe flash CS6 file with a countdown timer in it. But I cannot get it to work right I was wondering if anybody will be willing to download the file I would be happy to send it to them if you think you can look in it and fix in the right timer countdown action script for it. Countdown to Halloween. And a two-minute in 60 seconds timer. Please anyone message me back. Thanks


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 03:51:45


At 10/28/14 02:35 AM, Rovertarthead wrote: Hi if there's any action scriptur out there I have a file I will be willing to send to you if you can help me out and fix it for me on it. I have Adobe flash CS6 file with a countdown timer in it. But I cannot get it to work right I was wondering if anybody will be willing to download the file I would be happy to send it to them if you think you can look in it and fix in the right timer countdown action script for it. Countdown to Halloween. And a two-minute in 60 seconds timer. Please anyone message me back. Thanks

I already tried to help you, but you just ignored me...
Also, this is your 3rd thread for this problem or did I miss one?

Response to Serious help before Halloween pleas 2014-10-28 05:19:27


Wait no i did try it. It's just not working.


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

At 10/28/14 05:19 AM, Rovertarthead wrote: Wait no i did try it. It's just not working.

What I posted was not a solution to fix your problem, it was to try finding what your problem is.
We can't help you if we don't know whats wrong, but you just keep telling us that it doesn't work.

I'll ask again, what does not work?
Do you get an error?
Is your problem to put the calculated values into a textfield or are the calculations wrong?
Or something else?

And if an answer doesn't instantly solve your problem, take your time to tell us that you tried and what exactly happened when you executed it. We can continue solving your problem from there.

Response to Serious help before Halloween pleas 2014-10-28 20:28:01


At 10/28/14 02:58 PM, Etherblood wrote:
At 10/28/14 05:19 AM, Rovertarthead wrote: Wait no i did try it. It's just not working.
What I posted was not a solution to fix your problem, it was to try finding what your problem is.
We can't help you if we don't know whats wrong, but you just keep telling us that it doesn't work.

I'll ask again, what does not work?
Do you get an error?
Is your problem to put the calculated values into a textfield or are the calculations wrong?
Or something else?

And if an answer doesn't instantly solve your problem, take your time to tell us that you tried and what exactly happened when you executed it. We can continue solving your problem from there.

I know I'm sorry just that I tried other solutions and I guess I got mixed up with all of them and also I can't seem to get any of them to work right I put in the action script and the numbers symbol but when I test movie out of Swf file The timer isn't showing up and is still invisible with the action script on. I guess I could try it one more time though. But I am willing to send anybody who think they can fix it send them my file. And one of the problems is I can't really figure out where exactly to put the numbers or the amount to get it right. Because it's said that changing the date or the year changes the time which is very confusing to me. And I tried when I put it in but it still invisible. and I do get an error on the output I will send you a screenshot.also there's one on compiler Errors. And okay I will give you even more details as I can thanks for your help.


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 21:00:48


At 10/28/14 08:28 PM, Rovertarthead wrote: and I do get an error on the output I will send you a screenshot.also there's one on compiler Errors.

No need to screen the error(s), you can just copy it as text, what does it say?

Response to Serious help before Halloween pleas 2014-10-28 21:20:55


At 10/28/14 09:00 PM, Etherblood wrote:
At 10/28/14 08:28 PM, Rovertarthead wrote: and I do get an error on the output I will send you a screenshot.also there's one on compiler Errors.
No need to screen the error(s), you can just copy it as text, what does it say?

Sure here they are >

Server error! Unable to obtain date from server
Error opening URL 'file:////Volumes/Macintosh%20HD/Users/keithendow/Desktop/Trevors%20MacBook%20Pro%20Desktop/Trevors%20iMac%20Desktop/Trevors%20folder/Trevors%20Artwork/Animation/Haloween%20window%20animations/Halloween%20Projector%20animations%20Completed/gettime.php'

And

Scene=Original scene, layer=Lables, frame=2919, Line 1 Mouse events are permitted only for button instances


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 21:26:57


At 10/28/14 09:20 PM, Rovertarthead wrote: Server error! Unable to obtain date from server
Error opening URL 'file:////Volumes/Macintosh%20HD/Users/keithendow/Desktop/Trevors%20MacBook%20Pro%20Desktop/Trevors%20iMac%20Desktop/Trevors%20folder/Trevors%20Artwork/Animation/Haloween%20window%20animations/Halloween%20Projector%20animations%20Completed/gettime.php'

are you still using the code from last thread?

this.onEnterFrame = function()
{
var today:Date = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();
var targetDate:Date = new Date(2016,7,25);
var targetTime = targetDate.getTime();
var timeLeft = targetTime - currentTime;
var sec = Math.floor(timeLeft/1000);
var min = Math.floor(sec/60);
var hours = Math.floor(min/60);
var days = Math.floor(hours/24);
sec = String(sec % 60);
if(sec.length < 2){
sec = "0" + sec;
}
min = String(min % 60);
if(min.length < 2){
min = "0" + min;
}
hours = String(hours % 24);
if(hours.length < 2){
hours = "0" + hours;
}
days = String(days);
if(timeLeft > 0 ){
var counter:String = days + ":" + hours + ":" + min + ":" + sec;
time_txt.text = counter;
}else{
trace("TIME'S UP");
var newTime:String = "00:00:00:00";
time_txt.text = newTime;
delete (this.onEnterFrame);
}
}

if not, what does your current code look like?

Response to Serious help before Halloween pleas 2014-10-28 21:30:54


Ok no I tried another code so I erased that one and am just going to go by yours. So ok I put this one back in you just gave me and it is working.. But not quiet the numbers are speeding tho randomly now in the SWF export file.


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 21:33:26


Oh and it says this on it too now >

Serious help before Halloween pleas


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

At 10/28/14 09:30 PM, Rovertarthead wrote: Ok no I tried another code so I erased that one and am just going to go by yours. So ok I put this one back in you just gave me and it is working.. But not quiet the numbers are speeding tho randomly now in the SWF export file.

This is not my code, this is the code you posted in your last thread.
At least we're making progress now.
I assume the number of digits for each part is correct? ("00:00:00:00")
I can't find an error in the calculations, but i'll check again.
The mouse event error is unrelated to this problem and likely somewhere else in your file.

Response to Serious help before Halloween pleas 2014-10-28 22:29:27


Oh ok yea it was and yes it is at all 00000 and take a look at the upload i just did heres what it looks like right now. > http://www.newgrounds.com/portal/view/646656


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 22:45:33


At 10/28/14 10:29 PM, Rovertarthead wrote: Oh ok yea it was and yes it is at all 00000 and take a look at the upload i just did heres what it looks like right now. > http://www.newgrounds.com/portal/view/646656

Hmm... We'll just step through it and see where it goes wrong.

var timeLeft = targetTime - currentTime;
trace(timeLeft );// <--insert this trace
var sec = Math.floor(timeLeft/1000);

Try putting in this trace and see what the output says.
It represents your countdown in milliseconds, if it works as it's supposed to, the trace output should show a really large number which is decreasing 1000 units per second.
I suspect the string conversion stuff afterwards to cause the issues if this works.

Response to Serious help before Halloween pleas 2014-10-28 22:49:04


Ok sure thing and where do i put this on the top or bottom of the action script that i have on now? Or just replace the whole script with this one?


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 22:53:20


Oh you mean like this right here?

Serious help before Halloween pleas


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 22:53:21


At 10/28/14 10:49 PM, Rovertarthead wrote: Ok sure thing and where do i put this on the top or bottom of the action script that i have on now? Or just replace the whole script with this one?

The line above and below the trace are already in your script, search for them and place the trace inbetween.

Response to Serious help before Halloween pleas 2014-10-28 22:55:08


At 10/28/14 10:53 PM, Rovertarthead wrote: Oh you mean like this right here?
this.onEnterFrame = function()
{
var today:Date = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();
var targetDate:Date = new Date(2016,7,25);
var targetTime = targetDate.getTime();
var timeLeft = targetTime - currentTime;

trace(timeLeft );// <--insert this trace

var sec = Math.floor(timeLeft/1000);
var min = Math.floor(sec/60);
var hours = Math.floor(min/60);
var days = Math.floor(hours/24);
sec = String(sec % 60);
if(sec.length < 2){
sec = "0" + sec;
}
min = String(min % 60);
if(min.length < 2){
min = "0" + min;
}
hours = String(hours % 24);
if(hours.length < 2){
hours = "0" + hours;
}
days = String(days);
if(timeLeft > 0 ){
var counter:String = days + ":" + hours + ":" + min + ":" + sec;
time_txt.text = counter;
}else{
trace("TIME'S UP");
var newTime:String = "00:00:00:00";
time_txt.text = newTime;
delete (this.onEnterFrame);
}
}

It should look like this afterwards.

Response to Serious help before Halloween pleas 2014-10-28 22:59:57


Holy poop! I did this like you told me :

this.onEnterFrame = function()
{
var today:Date = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();
var targetDate:Date = new Date(2016,7,25);
var targetTime = targetDate.getTime();
var timeLeft = targetTime - currentTime;

trace(timeLeft );// <--insert this trace

var sec = Math.floor(timeLeft/1000);
var min = Math.floor(sec/60);
var hours = Math.floor(min/60);
var days = Math.floor(hours/24);
sec = String(sec % 60);
if(sec.length < 2){
sec = "0" + sec;
}
min = String(min % 60);
if(min.length < 2){
min = "0" + min;
}
hours = String(hours % 24);
if(hours.length < 2){
hours = "0" + hours;
}
days = String(days);
if(timeLeft > 0 ){
var counter:String = days + ":" + hours + ":" + min + ":" + sec;
time_txt.text = counter;
}else{
trace("TIME'S UP");
var newTime:String = "00:00:00:00";
time_txt.text = newTime;
delete (this.onEnterFrame);
}
}

And ended up with this on the Output:

57556911907
57556911731
57556911731
57556911703
57556911676
57556911633
57556911592
57556911550
57556911509
57556911467
57556911425
57556911380
57556911342
57556911300
57556911259
57556911213
57556911175
57556911134
57556911092
57556911050
57556911009
57556910967
57556910926
57556910879
57556910835
57556910800
57556910528
57556910527
57556910527
57556910527
57556910527
57556910527
57556910488
57556910450
57556910413
57556910380
57556910342
57556910301
57556910259
57556910217
57556910175
57556910134
57556910092
57556910051
57556910009
57556909962
57556909913
57556909880
57556909842
57556909801
57556909754
57556909227
57556909227
57556909227
57556909227
57556909227
57556909227
57556909227
57556909226
57556909226
57556909226
57556909226
57556909226
57556909164
57556909164
57556909134
57556909093
57556909050
57556908993
57556908967
57556908926
57556908883
57556908842
57556908800
57556908759
57556908717
57556908675
57556908633
57556908592
57556908550
57556908509
57556908467
57556908425
57556908383
57556908342
57556908300
57556908259
57556908217
57556908175
57556908132
57556908092
57556908050
57556908007
57556907967
57556907926
57556907883
57556907842
57556907800
57556907763
57556907717
57556907675
57556907638
57556907592
57556907550
57556907509
57556907467
57556907425
57556907384
57556907346
57556907300
57556907258
57556907217
57556907175
57556907138
57556907096
57556907050
57556906788
57556906787
57556906787
57556906787
57556906786
57556906786
57556906763
57556906721
57556906680
57556906633
57556906596
57556906554
57556906513
57556906471
57556906430
57556906168
57556906168
57556906167
57556906167
57556906167
57556906167
57556906134
57556906096
57556906054
57556906013
57556905971
57556905929
57556905887
57556905846
57556905805
57556905763
57556905721
57556905679
57556905638
57556905596
57556905555
57556905512
57556905471
57556905429
57556905387
57556905346
57556905305
57556905262
57556905221
57556905179
57556905137
57556905096
57556905055
57556905012
57556904971
57556904709
57556904709
57556904709
57556904709
57556904709
57556904708
57556904679
57556904638
57556904596
57556904554
57556904512


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 23:03:29


And it still speeds thro my numbers like nuts. Should I change the numbers to my own numbers? And is this were i put the action script?

Take a look at the numbers just in case

Serious help before Halloween pleas


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

At 10/28/14 11:03 PM, Rovertarthead wrote: And it still speeds thro my numbers like nuts. Should I change the numbers to my own numbers? And is this were i put the action script?

Very good, the output is exactly what I expected it to be, try this script:
(replace the current one with this)

this.onEnterFrame = function()
{
var today:Date = new Date();
var currentTime = today.getTime();
var targetDate:Date = new Date(2014,9,31);
var targetTime = targetDate.getTime();
var timeLeft = targetTime - currentTime;

if(timeLeft > 0 ){

var sec:int = timeLeft/1000;
var min:int = sec/60;
var hours:int = min/60;
var days:int = hours/24;

sec %= 60;
min %= 60;
hours %= 24;

var counter:String = days + ":";
if(hours < 10) counter += "0";
counter += hours + ":";
if(min < 10) counter += "0";
counter += min + ":";
if(sec < 10) counter += "0";
counter += sec;

time_txt.text = counter;
}else{
trace("TIME'S UP");
var newTime:String = "00:00:00:00";
time_txt.text = newTime;
delete (this.onEnterFrame);
}
}

I hope It'll work, It still does the same, but I no longer use the same var for text and numbers.
(again, I never used as2 and the stuff i wrote above is untested, so there are no guarantees)
If it doesn't work we'll just continue to test it, post any new errors pls.
If it does I'll explain how to make a 2:30 timer from here.

Response to Serious help before Halloween pleas 2014-10-28 23:45:37


Ok will do and thanks for all your help sorry I wasn't getting it right I was just having a hard time before. Also I just tried it and its still the same thing. Also now says this on the Compiler Errors

Serious help before Halloween pleas


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-28 23:54:27


At 10/28/14 11:45 PM, Rovertarthead wrote: Ok will do and thanks for all your help sorry I wasn't getting it right I was just having a hard time before. Also I just tried it and its still the same thing. Also now says this on the Compiler Errors

Ok, apparently as2 doesn't know int, try:

this.onEnterFrame = function()
{
var today:Date = new Date();
var currentTime:Number = today.getTime();
var targetDate:Date = new Date(2014,9,31);
var targetTime:Number = targetDate.getTime();
var timeLeft:Number = targetTime - currentTime;

if(timeLeft > 0 ){

var sec:Number = Math.floor(timeLeft/1000);
var min:Number = Math.floor(sec/60);
var hours:Number = Math.floor(min/60);
var days:Number = Math.floor(hours/24);

trace(sec);//<--trace for testing

sec %= 60;
min %= 60;
hours %= 24;

trace(sec);//<--trace for testing

var counter:String = days + ":";
if(hours < 10) counter += "0";
counter += hours + ":";
if(min < 10) counter += "0";
counter += min + ":";
if(sec < 10) counter += "0";
counter += sec;

time_txt.text = counter;
}else{
trace("TIME'S UP");
var newTime:String = "00:00:00:00";
time_txt.text = newTime;
delete (this.onEnterFrame);
}
}

Please tell me again what the output looks like when executing this. (a few lines are enough)

Response to Serious help before Halloween pleas 2014-10-29 00:05:53


Ok and a few lines of what are enough?

Uugh and now it says this:

Serious help before Halloween pleas


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-29 00:09:20


At 10/29/14 12:05 AM, Rovertarthead wrote: Ok and a few lines of what are enough?

A few lines of what is traced into the output.

this.onEnterFrame = function()
{
var today:Date = new Date();
var currentTime:Number = today.getTime();
var targetDate:Date = new Date(2014,9,31);
var targetTime:Number = targetDate.getTime();
var timeLeft:Number = targetTime - currentTime;

if(timeLeft > 0 ){

var sec:Number = Math.floor(timeLeft/1000);
var min:Number = Math.floor(sec/60);
var hours:Number = Math.floor(min/60);
var days:Number = Math.floor(hours/24);

trace(sec);//<--trace for testing

sec %= 60;
min %= 60;
hours %= 24;

trace(sec);//<--trace for testing

var counter:String = String(days) + ":";
if(hours < 10) counter += "0";
counter += String(hours) + ":";
if(min < 10) counter += "0";
counter += String(min) + ":";
if(sec < 10) counter += "0";
counter += String(sec);

time_txt.text = counter;
}else{
trace("TIME'S UP");
var newTime:String = "00:00:00:00";
time_txt.text = newTime;
delete (this.onEnterFrame);
}
}

Response to Serious help before Halloween pleas 2014-10-29 00:33:05


Hmm, number.toString() instead of String(number) might be better, try this instead:

this.onEnterFrame = function()
{
var today:Date = new Date();
var currentTime:Number = today.getTime();
var targetDate:Date = new Date(2014,9,31);
var targetTime:Number = targetDate.getTime();
var timeLeft:Number = targetTime - currentTime;

if(timeLeft > 0 ){

var sec:Number = Math.floor(timeLeft/1000);
var min:Number = Math.floor(sec/60);
var hours:Number = Math.floor(min/60);
var days:Number = Math.floor(hours/24);

trace(sec);//<--trace for testing

sec %= 60;
min %= 60;
hours %= 24;

trace(sec);//<--trace for testing

var counter:String = days.toString() + ":";
if(hours < 10) counter += "0";
counter += hours.toString() + ":";
if(min < 10) counter += "0";
counter += min.toString() + ":";
if(sec < 10) counter += "0";
counter += sec.toString();

time_txt.text = counter;
}else{
trace("TIME'S UP");
var newTime:String = "00:00:00:00";
time_txt.text = newTime;
delete (this.onEnterFrame);
}
}

Response to Serious help before Halloween pleas 2014-10-29 00:52:46


Nope none of them still worked. Is there anything I should change or delete? Like change anything here i should do or no?

Serious help before Halloween pleas


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-29 01:00:43


At 10/29/14 12:52 AM, Rovertarthead wrote: Nope none of them still worked. Is there anything I should change or delete? Like change anything here i should do or no?

I don't think you need to change any settings.

What was wrong with the last version? Another error?

Response to Serious help before Halloween pleas 2014-10-29 01:13:58


Ok and this is what the last one said.

Serious help before Halloween pleas


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-29 01:15:26


And this.

Serious help before Halloween pleas


Giving Toons Life! Faceme! Tweetme! Linkme! Instime! Deviantme! ;D

BBS Signature

Response to Serious help before Halloween pleas 2014-10-29 01:26:04


At 10/29/14 01:15 AM, Rovertarthead wrote: And this.

Ok, the calculations should be correct, this means the issue is either converting to string or setting the textfield text.
What is the output of this?

this.onEnterFrame = function()
{
var today:Date = new Date();
var currentTime:Number = today.getTime();
var targetDate:Date = new Date(2014,9,31);
var targetTime:Number = targetDate.getTime();
var timeLeft:Number = targetTime - currentTime;

if(timeLeft > 0 ){

var sec:Number = Math.floor(timeLeft/1000);
var min:Number = Math.floor(sec/60);
var hours:Number = Math.floor(min/60);
var days:Number = Math.floor(hours/24);

sec %= 60;
min %= 60;
hours %= 24;

var counter:String = days.toString() + ":";
if(hours < 10) counter += "0";
counter += hours.toString() + ":";
if(min < 10) counter += "0";
counter += min.toString() + ":";
if(sec < 10) counter += "0";
counter += sec.toString();

trace(counter);//<--trace for testing

time_txt.text = counter;
}else{
trace("TIME'S UP");
var newTime:String = "00:00:00:00";
time_txt.text = newTime;
delete (this.onEnterFrame);
}
}

And also, just to make sure, the name of your time textfield is "time_txt" ?