• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

as3 SharedObject || how can i save my score?

New Here ,
Jan 28, 2016 Jan 28, 2016

Copy link to clipboard

Copied

so.. this is my code

as.png

"so.flush();" -- It keeps my points right?

Unfortunately it does not work for me..

Can someone please fix my code?

TOPICS
ActionScript

Views

534

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jan 28, 2016 Jan 28, 2016

You're setting score but not doing the flush(). You are only doing flush() in the else. This should work better:

if(so.data.score == null){

     so.data.score = level_mc.bheus_tzt_all.text; //already a string...

     so.flush();

}else{

     level_mc.bheus_tzt_all.text = so.data.score;

}

Votes

Translate

Translate
New Here ,
Jan 28, 2016 Jan 28, 2016

Copy link to clipboard

Copied

Anyone who can help me a email disappointing  navtchyev@gmail.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 28, 2016 Jan 28, 2016

Copy link to clipboard

Copied

You're setting score but not doing the flush(). You are only doing flush() in the else. This should work better:

if(so.data.score == null){

     so.data.score = level_mc.bheus_tzt_all.text; //already a string...

     so.flush();

}else{

     level_mc.bheus_tzt_all.text = so.data.score;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2016 Jan 29, 2016

Copy link to clipboard

Copied

so.data.score_all = level_mc.bheus_tzt_all.text;
trace(so.data.score_all);

I did this and I worked in the (trace)

But I have to keep the score ...

how?

By the way your code does not really work for me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2016 Jan 29, 2016

Copy link to clipboard

Copied

i can to talk with you in private?

facebook?

of skyp  or something?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 29, 2016 Jan 29, 2016

Copy link to clipboard

Copied

LATEST

Testing for null is only done the one time to initialize the shared object. To store the score you need to both set the property and then flush it:

so.data.score_all = yourScore...

so.flush();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines