A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: how to save score over fames

  1. #1
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874

    how to save score over fames

    How can save the users score for the next frame?
    Im using dynamic text box and it all gose somthing like this
    sory for the mistakes it rote it up just now
    Code:
    //frame1 - 2 layer score
    _root.score = 0;
    // Varible for the dymanic text box
    scorer
    // MC called my.MC layer game frame1
    on(release){
    _root.score +=1;
    _root.scorer.text = _root.score;
    }
    Why dose the dynamix text box still come up with 0 on frame 2 should _root.score show the same number as before from frame 1
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  2. #2
    Senior Member ihoss.com's Avatar
    Join Date
    Oct 2004
    Location
    Norway
    Posts
    581
    set the variable in the textbox in frame 2 to be _root.score, not scorer. if you use .text then you have to set the name of the textbox. The name field is to the far left, while the variable is to the right (in the properties panel).

    Now you have asked at least 3 questions in less than a day that are realy simple. Do you think you could read the tutorials instead of asking every time?

  3. #3
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    If you have different dynamic text boxes with same name in frame1 and frame2 then it means text box is destroyed and rebuilt in frame2. When dynamic text box is created, it does not get value for its text by default, you have to set it every time yourself.

    So, use text box in other layer where it covers both frames without new keyframe or set the text again in frame2 using _root.scorer.text = _root.score;

    (Or follow the advice from ihoss).

  4. #4
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    What do you mnea i have asked 3 q's in a day that was my only i think... i also asked were to find a certain sound loop... i must have short term memory loss or somthing

    thanks for the advice
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  5. #5
    Senior Member ihoss.com's Avatar
    Join Date
    Oct 2004
    Location
    Norway
    Posts
    581
    sorry, there were just a lot of noobs here today

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