A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Problem with counting game

Hybrid View

  1. #1
    Member
    Join Date
    Jan 2004
    Location
    Ontario,Canada
    Posts
    76

    [HELP] Problem with counting game

    hey guys, I'm working on this counting game for little kids but I have a problem. The function I have works fine the first time its called and shows the right number of tp's but when it's called again it gives almost a random number. Here's the link http://www.geocities.com/xanderjz99/newed-cd.swf

    This is my function:

    function settp() {
    _root.vartpon=0
    i = 0;
    while (i<=9) {
    _root[vartp+i] = int(random(2));
    if (_root[vartp+i] == 0) {
    _root["tp"+(i)].gotoAndPlay("yes");
    _root.vartpon =_root.vartpon+ 1;
    }
    if (_root[vartp+i] == 1) {
    _root["tp"+(i)].gotoAndPlay("no");
    }

    i++;
    }
    }


    Hope someone can help
    Last edited by Xander99; 03-22-2004 at 08:38 PM.

  2. #2
    Senior Member St. Nick's Avatar
    Join Date
    Sep 2003
    Location
    Ontario, Canada
    Posts
    312
    The link doesn't work, I don't think geocities lets you link swf files maybe? Anyways, try linking an html page with the swf embeded on it. That should work.

  3. #3
    Member
    Join Date
    Jan 2004
    Location
    Ontario,Canada
    Posts
    76
    always forgetting that grr adds to my great day lol k here's the link and the fla
    http://www.geocities.com/xanderjz99/newed-cd.html
    http://www.geocities.com/xanderjz99/newed-cd.fla

    hope some1 can help , probably just one stupid problem

  4. #4
    magnetologicus Magnetos_II's Avatar
    Join Date
    Jan 2004
    Location
    real date May 2001
    Posts
    572
    dont know if this helps but here you go
    it quite simple really

    its MX format
    Attached Files Attached Files

  5. #5
    Member
    Join Date
    Jan 2004
    Location
    Ontario,Canada
    Posts
    76
    thx that will help a lot it probably has 2 do with me using a while loop instead of a for

  6. #6
    magnetologicus Magnetos_II's Avatar
    Join Date
    Jan 2004
    Location
    real date May 2001
    Posts
    572
    Originally posted by Xander99
    thx that will help a lot it probably has 2 do with me using a while loop instead of a for
    there isnt much difference between a for loop and a while loop
    at least none that would make any difference for the game you are doing

    both loops work fine

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