-
help me make flash 5 code work with video chat app
hi guys,
I've got a video chat movie and I want to incorporate a countdown timer into it. Basically, when time runs out, a page pops up on the users screen.
Now, I have a timer that works wonderfully on it's own but, when I try to add it to my video app, it doesn't display any numbers.
The timer was created in the days of flash 5 and I think it may be using some outdated script. Can you take a look at the following code and tell me how I can make it work with my video chat (flash 6)?
Thank you very much!
// This tells text field "sec2" to count down by subtracting one
set("/:sec2", (/:sec2-1));
// This states that if text field "sec2" is less than 0 then tell text field "sec1" to subtract one and add a nine in text field "sec2", hence completeing the seconds countdown.
if (/:sec2<0) {
set("/:sec1", (/:sec1-1));
/:sec2 = "9";
}
// This tells text field "min" to subtract one when text field "sec1" is less than zero, hence counting down the minutes then setting text fields "sec1" and "sec2" to 5 and 9 reseting the seconds
if (/:sec1<0) {
set("/:min", (/:min-1));
/:sec1 = "5";
/:sec2 = "9";
}
timeUp = (/:sec1 == 0) && (/:sec2 == 0);
if (timeUp) {
stop();
getURL("http://www.mySite.com", "_blank");
} else {
gotoAndPlay("restart");
}
-
Wow.. that is some old looking code!
Here's something that should work:
Code:
this.cdID = setInterval(this,"countDown", 1000);// run once every second
this.count = 300; // 5 mins.
this.countDown = function() {
var c = this.count;
var min = Math.floor(c/60);
var sec = c - min*60;
if(sec<=0) {
sec = "00";
}
this.count_txt.text = min+":"+sec;
if(this.count <= 0) {
clearInterval(this.cdID);
getUrl("http://www.google.com","_blank");
}
this.count -= 1;
}
psx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|