A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: if thingy.....

  1. #1
    Junior Member
    Join Date
    May 2001
    Posts
    3
    Hey!
    I made a platform game from mad-sci's tutorial, but I want to make it so that when the score gets to a certain amount the movie jumps to a new frame. Here's the code I'm using in the frame:

    if (score eq 8) {
    gotoAndStop (2);
    }

    it doesn't work! I just can't figure out why.
    when i pick up the item the score says 8 but nothing happens... Please help, I really need to know how to do this! ("score" is the name of the text-field that displayes the score...)

    PS. I tried this code too but it was even more screwed up than the other one
    if (score = 8) {
    gotoAndStop (2); }
    it just sets the score to 8! plz help!

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    *whispers* try:

    Code:
    if (score == 8) { 
    gotoAndStop (2); 
    }
    I wont tell any one if you don’t!

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    P.S.

    You should read page #160-161 in your ActionScript Reference Guide.

    “Symbolic operators” are a must know if you would like to code any thing! Try to solve your problems, use what you have, then if you still need help try here. You will learn more if you do! Well good luck!

    Meow!

  4. #4
    Junior Member
    Join Date
    May 2001
    Posts
    3
    thanx, but it didn't work either...
    ok I'll read that, let's hope I'll learn something

    PS. Cool cat btw, did you draw it yourself?

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    You might try:
    Code:
    if (score >= 8) { 
    trace ("testing ok!");
    score = 0;
    this.gotoAndStop (2); 
    }
    If score is 8 or grater then 8 (X >= 8) ok

    If it still dissent work you should look elsewhere in your code?

    I have added a trace to see if the “if” statement is working at all? I am resetting the score to prevent the “if” from going off every frame!

    You might also want to check the path to the variable “score” if the path is incorrect it will not work!

    Well let me know if your still having troubles!

    Ooo ya. I am an artist or sum junk! Thanks!

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