Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    scoring in Flash - actionscript problem

    hi
    i am producing a quiz and have a scoring system. the quiz has a comment at the results page. the comments depend on the score. I have this scripting:

    Code:
    
    onEnterFrame = function(){
    if (this._parent._score = 0){
    this.resultText = "you didnt make an improvement";
    } 
    if (this._parent._score = 1,2,3,4,5){
    this.resultText = "you hardly made an improvement";
    }
    if (this._parent._score = 6,7,8,9,10){
    this.resultText = "almost full points, well done";
    }
    }
    well u get the picture... the code skips all the if statements and goes right to the last one and displays the last comment no matter what the score is. What is wrong?

  • #2
    fmx
    fmx is offline
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try-
    Code:
    onEnterFrame = function(){
    if (this._parent._score == 0){
    this.resultText = "you didnt make an improvement";
    } 
    if (this._parent._score >=1 && this._parent._score <=5){
    this.resultText = "you hardly made an improvement";
    }
    if (this._parent._score >= 6){
    this.resultText = "almost full points, well done";
    }
    }
    might need some tweaking, but you should get the idea... not sure what the onenterframe is for...

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    lol i originally wanted it to update the comments every frame but i scrapped that. thanks i will try that out.

  • #4
    New Coder
    Join Date
    Aug 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no now im getting that _level0.instance4.resultText message...

    i also tried else if but that also doesnt work.. any other ideas??


  •  

    Posting Permissions

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