A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Dynamic Text for Score

  1. #1

    Dynamic Text for Score

    I just need to know how can I display the score of my game in the game screen area using a dynamic text in AS3. It was easy in AS2 but I need to learn how to do it in AS3.

    The score variable is named as globalScore

    Any coding samples will be appreciated very much. Thanks.
    AdJesvm

  2. #2
    Lurker at Heart EgoAnt's Avatar
    Join Date
    Apr 2004
    Location
    The basement
    Posts
    314
    The simple answer is that you can add a text field to the stage and make it dynamic. Below the Dynamic Text selector is a field called "<Instance Name>", I set that to dtShowScore. Then, to change the text on the text field use:

    Code:
    dtShowScore.text = globalScore.toString();
    Speed up your development time with well documented and easy to implement Flash components.
    That's what I do, I save people.... Save them from work. I'm like a slacker superhero, standing for truth, justice, and the consumption of sugary pastries.

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