A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: !!!im Back!!!

  1. #1
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437

    !!!im Back!!!

    hey guys... im back from holidays!!! i also got my own computer now so i can do flash stuff without clogging this one up - i havnt got an internet connection yet tho. neway im still trying to get that timer working... finish line script
    Code:
    onClipEvent (load) {
        _root.laps = 0;
        _root.lastc = 3;
        _root.bestlapt = 10.7;
        _root.lastlapt = 0;
        start = false;
    }
    onClipEvent (enterFrame) {
        if (start) {
            _root.elapsedt = Math.round((getTimer()-start)/100)/10;
        }
        if (this.hitTest(_root.supercar)) {
            if (_root.lastc == 3) {
                _root.laps++;
                _root.lastc = 0;
                if (start) {
                    _root.lastlapt = Math.round((getTimer()-start)/100)/10;
                    if (_root.lastlapt<_root.bestlapt) {
                        _root.bestlapt = _root.lastlapt;
                    }
                }
                start = getTimer();
            }
        }
    }
    3rd checkpoint
    Code:
    onClipEvent (enterFrame) {
        if (this.hitTest(_root.supercar)) {
            if (_root.lastc == 2) {
                _root.lastc = 3;
            }
            if (_root.lastc>3) {
                _root.lastc = 3;
            }
        }
    }
    2nd checkpoint
    Code:
    onClipEvent (enterFrame) {
        if (this.hitTest(_root.supercar)) {
            if (_root.lastc == 1) {
                _root.lastc = 2;
            }
            if (_root.lastc>2) {
                _root.lastc = 2;
            }
        }
    }
    1st checkpoint
    Code:
    onClipEvent (enterFrame) {
        if (this.hitTest(_root.supercar)) {
            if (_root.lastc == 0) {
                _root.lastc = 1;
            }
            if (_root.lastc>1) {
                _root.lastc = 1;
            }
        }
    }
    there is the code - i dont know why it doesnt work
    thanks

  2. #2
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437
    doesnt ne1 know how this timer works??? its one of the ones off edmacks 'loads of game .flas' post. ive seen it done b4 but i cant get it to work for me. neway could someone please help me... thanks

  3. #3
    Elvis...who tha f**k is Elvis? phreax's Avatar
    Join Date
    Feb 2001
    Posts
    1,836
    Well' first off I don't think you should have 2 variables named start! You use it both as a boolean and integer variable!
    Streets Of Poker - Heads-Up Texas Hold'em Poker Game

  4. #4
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437
    ah yes i see the 2 variables. btw i havnt named ne instance start. in the code
    Code:
    onClipEvent (load) {
        _root.laps = 0;
        _root.lastc = 3;
        _root.bestlapt = 10.7;
        _root.lastlapt = 0;
        start = false;
    }
    onClipEvent (enterFrame) {
        if (start) {
            _root.elapsedt = Math.round((getTimer()-start)/100)/10;
        }
        if (this.hitTest(_root.supercar)) {
            if (_root.lastc == 3) {
                _root.laps++;
                _root.lastc = 0;
                if (start) {
                    _root.lastlapt = Math.round((getTimer()-start)/100)/10;
                    if (_root.lastlapt<_root.bestlapt) {
                        _root.bestlapt = _root.lastlapt;
                    }
                }
                start = getTimer();
            }
        }
    }
    why does it say -start??? ur meaning the start = getTimer(); and start = false; being boolean and integar arnt you. i tried swapping the code around but it doesnt work (im not very good yet with actionscript as u can tell), changing from start to elapsdt but it doesnt work... the think i dont get is why it says 'start' when nothing (that i can find) in the .fla even says start:S man im confuzed:S thanks
    Attached Files Attached Files

  5. #5
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    You should replace line
    _root.bestlapt = 10.7;

    with
    _root.bestlapt = 0;


    and replace line
    if (_root.lastlapt<_root.bestlapt) {

    with
    if (_root.lastlapt<_root.bestlapt or _root.bestlapt==0) {

    At least it worked for me then

  6. #6
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437
    :'( i dont understand what im doing wrong here - its still not working:'( i tried it twice... typing it by myself and copy paste and it still doesnt work:S man this is anoying - ive tried so many things. neway do u know wat im doing rong??? thanks alot:>

    btw - i like that pic u got:P

  7. #7
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    try my fla

  8. #8
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437
    the wierdest thing happened to me bout 10 min ago... i was geting frustrated with this timer thing coz ive been on it so long, so i decided to put it on here for people to download and help me with. so i started changing the cars grahpics from cars to boxes and deleted the car pics from the library. then it worked... im like - HUH whats going on here - do u know how to explain my problem??? thanx for the fla man im so confuzed y it worked - was it coz of the names that i gave the graphics??? i dono, neway... thankyou

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