A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: AS2 Score Counter Problem !

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    1

    AS2 Score Counter Problem !

    Hey Everyone ,
    Lets say I am makeing a platform game and I have 5 frames, the first frame is the level selection frame and the 4 frames are levels,
    I would like to create a score (dynamic text) in all of the 5 frames but i have one problem the score rests in every frame i know it's
    because of the score=0 in every frame ,so is there is a better way to do this ?

    Thanks

  2. #2
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    Hi.

    What happens if you store the score in a variable? That way, you don't have to rely on the text field to remember the score, and you can simply set the value of the text to 'score:' + myScore , am I right?

    You may also want to store your levels on the frames of a movie clip instead of _root, for the sake of organisation, but I'm leaving that up to you.

    Hope this helps you, good luck with your game!

  3. #3
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Set
    Actionscript Code:
    score=0;
    only in the first level's frame, and in the other levels don't set any value, just place the dynamic textbox in all the frames, and the next levels after the first, will have the value of the first level. If in the first level you gained 100 points, then when you go to frame 2 ( level 2) it will keep showing score=100;

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