Any flash experts care to give me a hand?

Discuss computers and technology here.
User avatar
Mugen9s
Global moderator
Posts: 1078
Joined: Sun Jun 01, 2008 6:35 pm
Are you a spam bot?: NO
Location: United Kingdom
Contact:

Any flash experts care to give me a hand?

Postby Mugen9s » Fri Aug 22, 2008 9:10 pm

Ok so im on my first ever try in the flash department and i am far from bieng an expert at it so here is my dilemma. I'm making a game but I do not know how to put a countdown in the game (so the player has to finish the game quick);the game is a shooter called head shot, its more of a game to play when you want to pent out stress or are just bored. Im also not a genius with action script so detailed explanation's will be great. Here is a version of my game, also please remember i started learning flash 3 days ago so this is its nothing complete -
http://www.mediafire.com/?o7kclltpzym

I would like the count down to start after the first screen and end at the "the end" screen, I would also like the final time to be displayed at the end.

Help would be much apreciated :)
R.I.P Rudy. You will always remain in our hearts and prayers.

User avatar
Mugen9s
Global moderator
Posts: 1078
Joined: Sun Jun 01, 2008 6:35 pm
Are you a spam bot?: NO
Location: United Kingdom
Contact:

Re: Any flash experts care to give me a hand?

Postby Mugen9s » Sat Sep 06, 2008 12:21 am

:hanghead:
R.I.P Rudy. You will always remain in our hearts and prayers.

Kinks
Posts: 640
Joined: Sat May 31, 2008 7:59 pm

Re: Any flash experts care to give me a hand?

Postby Kinks » Sat Sep 06, 2008 8:33 am

Sorry hunny, I have no idea :(
R.I.P Rudy....Heaven has one more angel and the night sky has one more star, the biggest out there. I love you xxx

User avatar
Mugen9s
Global moderator
Posts: 1078
Joined: Sun Jun 01, 2008 6:35 pm
Are you a spam bot?: NO
Location: United Kingdom
Contact:

Re: Any flash experts care to give me a hand?

Postby Mugen9s » Sat Sep 06, 2008 3:22 pm

:( It ok thanks for reply anyway :4u:
R.I.P Rudy. You will always remain in our hearts and prayers.

User avatar
Godfrey Parks
Posts: 143
Joined: Sun Jun 01, 2008 7:39 pm
Location: Scotland

Re: Any flash experts care to give me a hand?

Postby Godfrey Parks » Mon Sep 08, 2008 12:34 am

I've toyed with flash, mainly for web sites. I've never used flash for games development so I don't think I can help.

God :)
Image
Go Greener Scottish Government TV Ad.

User avatar
Rudy
Caiman Moderator
Posts: 2704
Joined: Sat May 31, 2008 7:42 pm
Location: Belgium
Contact:

Re: Any flash experts care to give me a hand?

Postby Rudy » Mon Sep 08, 2008 9:33 am

Maybe use getTimer ;)

Here an example I googled for ;)

Code: Select all

ACTIONSCRIPT:
start_time = getTimer();
countdown = 7200000;
onEnterFrame = function () {
    elapsed_time = getTimer()-start_time;
    _root.count.text = time_to_string(elapsed_time);
    _root.count_down.text = time_to_string(_root.countdown-elapsed_time);
};
function time_to_string(time_to_convert) {
    elapsed_hours = Math.floor(time_to_convert/3600000);
    remaining = time_to_convert-(elapsed_hours*3600000);
    elapsed_minutes = Math.floor(remaining/60000);
    remaining = remaining-(elapsed_minutes*60000);
    elapsed_seconds = Math.floor(remaining/1000);
    remaining = remaining-(elapsed_seconds*1000);
    elapsed_fs = Math.floor(remaining/10);
    if (elapsed_hours<10) {
        hours = "0"+elapsed_hours.toString();
    } else {
        hours = elapsed_hours.toString();
    }
    if (elapsed_minutes<10) {
        minutes = "0"+elapsed_minutes.toString();
    } else {
        minutes = elapsed_minutes.toString();
    }
    if (elapsed_seconds<10) {
        seconds = "0"+elapsed_seconds.toString();
    } else {
        seconds = elapsed_seconds.toString();
    }
    if (elapsed_fs<10) {
        hundredths = "0"+elapsed_fs.toString();
    } else {
        hundredths = elapsed_fs.toString();
    }
    return hours+":"+minutes+":"+seconds+":"+hundredths;
}

User avatar
Mugen9s
Global moderator
Posts: 1078
Joined: Sun Jun 01, 2008 6:35 pm
Are you a spam bot?: NO
Location: United Kingdom
Contact:

Re: Any flash experts care to give me a hand?

Postby Mugen9s » Mon Sep 08, 2008 7:37 pm

:o Thanks Rudy I will try the code out tomorrow :pals:
R.I.P Rudy. You will always remain in our hearts and prayers.


Return to “TECH DISCUSSION”

Who is online

Users browsing this forum: No registered users and 1 guest