A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Koolmoves and Flash trace

  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    78

    Koolmoves and Flash trace

    Hi,
    The "exchange menu1" and "arrays, strings" threads can be closed. Thanks for the solution.
    Next problem!
    Why doesn't Koolmoves use trace?
    I have two txtboxes, one shows % correct (works) and the other is for a conditional response but this is not working. Can someone tell me why?

    txt7var = Math.round((new_score/4)*100);
    txt9var = "";
    this.onEnterFrame = function() {
    if (this._currentframe == '14') {
    if(txt7var >= 70){txt9var.text = 'well done'}

    }else if(txt7var <= 69){txt9var.text = 'repeat'}


    }
    }
    }
    }
    Selection.setFocus("txt9var");
    stop();
    thanks,
    ja

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    I believe _currentframe should be a number (I am not an action script expert).

    In this._currentframe == '14'
    the value being tested is a string

  3. #3
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Quote Originally Posted by jarnold View Post
    I have two txtboxes, one shows % correct (works) and the other is for a conditional response but this is not working. Can someone tell me why?
    A textfield variable and a textfield name are not the same.
    You can set a text to txt9var or to txt9.text but not to txt9var.text since txt9var is a variable and not a dynamic textfield. For the same reason your setFocus will fail the way you used it. You can set focus to a textfield instance but not to a variable.

  4. #4
    Member
    Join Date
    Aug 2008
    Posts
    78
    Quote Originally Posted by w.brants View Post
    A textfield variable and a textfield name are not the same.
    You can set a text to txt9var or to txt9.text but not to txt9var.text since txt9var is a variable and not a dynamic textfield. For the same reason your setFocus will fail the way you used it. You can set focus to a textfield instance but not to a variable.
    Thanks to you both for the reply
    Didn't see the '14'. Still not working properly. Less than 70% shows " you should repeat this" but 100% doesn't show "well done".

    txt7var = Math.round((new_score/4)*100);
    txt9var = "";
    this.onEnterFrame = function() {
    if (this._currentframe == 'score') {
    if(txt7var >= 70){txt9.text = 'Well done'}

    }else if(txt7var < 70){txt9.text = 'You should repeat this'}


    }
    }
    }
    }
    Selection.setFocus("txt9var");
    stop();

    thanks
    ja
    Last edited by jarnold; 06-01-2009 at 12:47 AM.

  5. #5
    Member
    Join Date
    Aug 2008
    Posts
    78

    Spot my conditional statement problem please?

    Hi all,
    I've tried suggested changes.
    If I change 'score' to (18) - frame which scores the < 70 doesn't work but the >=70 returns 'well done'.
    If I leave 'score' then >=70 returns nothing but <70 works and returns 'repeat this'.
    I can't seem to be able to get both conditions to work depending on the score.

    txt7var = Math.round((new_score/4)*100);
    txt9var = "";
    this.onEnterFrame = function() {
    if (this._currentframe == 'score') {
    if(txt7var >= 70){txt9.text = 'Well done'}

    }else if(txt7var < 70){txt9.text = 'You should repeat this'}


    }
    }
    }
    }
    Selection.setFocus("txt9var");
    stop();

    thanks,
    ja

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