A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [F8] time remaining becomes score

Hybrid View

  1. #1
    Junior Member
    Join Date
    Aug 2006
    Posts
    10

    [F8] time remaining becomes score

    Hiya

    I want to make a scoreboard for my flash mini game but so that the time remaining becomes the score (so the quicker you do it the more points you get!).

    I have created my timer as a movie clip with a dynamic textbox with the variable name timer. This is then dragged onto the main timeline and given the instance name of countdown,

    The following code makes it work:

    Code:
    countdown.onEnterFrame = function() {
    	this.timer = int(30-(getTimer()-startTime)/1000);
    	if (Number(this.timer) == 0) {
    		gotoAndPlay(108);
    	}
    	timer = 0;
    }
    Then the freeze the timer on the game over screen i have the code:

    Code:
    countdown.onEnterFrame = function() {
    	stop();
    };
    I want to somehow put this "frozen" time into a variable which can be sent to the scoreboard. Any ideas on how I could go about doing this?

    thanks a lot

  2. #2
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    score += timer.dynamiceTextBox.text.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  3. #3
    Junior Member
    Join Date
    Aug 2006
    Posts
    10
    heya thanks for the help!

    I've tried putting a dynamic textbox onto the stage, with the variable name of timer or countdown and have played around with the code:

    score += timer.dynamicTextBox.text

    but it just returns the value of '0' or of 'level0.countdown'

    what am i doing wrong?

  4. #4
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    score += timer.text
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center