dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    12

    Question Error 1067 [AS3] Please help!!

    Code:
    var pointsWin:int = 1;
    var pointsLose:int = -1;
    var gameScore:int;
    
    gameScore = 0;
    
    showScore_tb.text = gameScore;
    I keep getting this error
    1067: Implicit coercion of a value of type int to an unrelated type String.
    showScore_tb.text = gameScore;
    Last edited by ksaul; 11-05-2008 at 12:47 AM.

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    You need to convert the number (gameScore) into a string before putting it into the text field...use one of these:

    showScore_tb.text = String(gameScore);
    showScore_tb.text = "" + gameScore;
    showScore_tb.text = gameScore as String;

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    12
    i always make stupid mistakes, thank you!!

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

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.